From 3315d4b105e7d581afcfbed6c89cd192790d1823 Mon Sep 17 00:00:00 2001 From: Vernon Keenan Date: Fri, 30 Jul 2021 20:05:02 -0700 Subject: [PATCH] Initial commit --- .gitignore | 20 + Makefile | 140 + README.md | 3 + api/auth/auth_client/auth_client.go | 116 + .../auth_client/user/get_users_parameters.go | 165 + .../auth_client/user/get_users_responses.go | 261 + api/auth/auth_client/user/user_client.go | 86 + api/auth/auth_models/address.go | 72 + api/auth/auth_models/error.go | 60 + api/auth/auth_models/response_meta.go | 84 + api/auth/auth_models/tenant_user.go | 99 + api/auth/auth_models/user.go | 376 + api/auth/auth_models/user_response.go | 158 + api/auth/auth_models/user_role.go | 90 + api/cloud/cloud_client/cloud_client.go | 126 + .../cors/account_options_parameters.go | 130 + .../cors/account_options_responses.go | 113 + api/cloud/cloud_client/cors/cors_client.go | 84 + .../cloud_client/hub/delete_hub_parameters.go | 165 + .../cloud_client/hub/delete_hub_responses.go | 270 + .../cloud_client/hub/get_hubs_parameters.go | 340 + .../cloud_client/hub/get_hubs_responses.go | 278 + api/cloud/cloud_client/hub/hub_client.go | 215 + .../cloud_client/hub/post_hubs_parameters.go | 155 + .../cloud_client/hub/post_hubs_responses.go | 278 + .../cloud_client/hub/put_hub_parameters.go | 155 + .../cloud_client/hub/put_hub_responses.go | 278 + .../cloud_client/user/get_users_parameters.go | 165 + .../cloud_client/user/get_users_responses.go | 261 + api/cloud/cloud_client/user/user_client.go | 86 + api/cloud/cloud_models/address.go | 72 + api/cloud/cloud_models/delete_response.go | 158 + api/cloud/cloud_models/error.go | 60 + api/cloud/cloud_models/hub.go | 93 + api/cloud/cloud_models/hub_request.go | 116 + api/cloud/cloud_models/hub_response.go | 158 + api/cloud/cloud_models/message.go | 57 + api/cloud/cloud_models/response_meta.go | 84 + api/cloud/cloud_models/tenant_user.go | 99 + api/cloud/cloud_models/user.go | 376 + api/cloud/cloud_models/user_response.go | 158 + api/cloud/cloud_models/user_role.go | 90 + .../crm_client/accounts/accounts_client.go | 258 + .../accounts/delete_account_parameters.go | 165 + .../accounts/delete_account_responses.go | 315 + .../get_accounts_observable_parameters.go | 268 + .../get_accounts_observable_responses.go | 321 + .../accounts/get_accounts_parameters.go | 340 + .../accounts/get_accounts_responses.go | 323 + .../accounts/post_accounts_parameters.go | 155 + .../accounts/post_accounts_responses.go | 323 + .../accounts/put_account_parameters.go | 155 + .../accounts/put_account_responses.go | 323 + .../crm_client/companies/companies_client.go | 172 + .../get_companies_observable_parameters.go | 165 + .../get_companies_observable_responses.go | 321 + .../companies/get_companies_parameters.go | 165 + .../companies/get_companies_responses.go | 323 + .../companies/post_companies_parameters.go | 155 + .../companies/post_companies_responses.go | 323 + .../crm_client/contacts/contacts_client.go | 258 + .../contacts/delete_contact_parameters.go | 165 + .../contacts/delete_contact_responses.go | 315 + .../get_contacts_observable_parameters.go | 268 + .../get_contacts_observable_responses.go | 321 + .../contacts/get_contacts_parameters.go | 340 + .../contacts/get_contacts_responses.go | 323 + .../contacts/post_contacts_parameters.go | 155 + .../contacts/post_contacts_responses.go | 323 + .../contacts/put_contacts_parameters.go | 155 + .../contacts/put_contacts_responses.go | 323 + .../account_options_observable_parameters.go | 130 + .../account_options_observable_responses.go | 113 + .../cors/account_options_parameters.go | 130 + .../cors/account_options_responses.go | 113 + .../company_observable_options_parameters.go | 130 + .../company_observable_options_responses.go | 113 + .../cors/company_options_parameters.go | 130 + .../cors/company_options_responses.go | 113 + .../contact_options_observable_parameters.go | 130 + .../contact_options_observable_responses.go | 113 + .../cors/contact_options_parameters.go | 130 + .../cors/contact_options_responses.go | 113 + api/crm/crm_client/cors/cors_client.go | 363 + .../lead_options_observable_parameters.go | 130 + .../cors/lead_options_observable_responses.go | 113 + .../cors/lead_options_parameters.go | 130 + .../crm_client/cors/lead_options_responses.go | 113 + api/crm/crm_client/crm_client.go | 136 + .../leads/delete_lead_parameters.go | 165 + .../crm_client/leads/delete_lead_responses.go | 315 + .../leads/get_leads_observable_parameters.go | 233 + .../leads/get_leads_observable_responses.go | 321 + .../crm_client/leads/get_leads_parameters.go | 306 + .../crm_client/leads/get_leads_responses.go | 323 + api/crm/crm_client/leads/leads_client.go | 258 + .../crm_client/leads/post_leads_parameters.go | 155 + .../crm_client/leads/post_leads_responses.go | 323 + .../crm_client/leads/put_leads_parameters.go | 155 + .../crm_client/leads/put_leads_responses.go | 323 + api/crm/crm_models/account.go | 482 + api/crm/crm_models/account_basic.go | 251 + api/crm/crm_models/account_basic_response.go | 158 + api/crm/crm_models/account_request.go | 116 + api/crm/crm_models/account_response.go | 158 + api/crm/crm_models/address.go | 72 + api/crm/crm_models/company.go | 248 + api/crm/crm_models/company_request.go | 116 + api/crm/crm_models/company_response.go | 158 + api/crm/crm_models/contact.go | 275 + api/crm/crm_models/contact_request.go | 116 + api/crm/crm_models/contact_response.go | 158 + api/crm/crm_models/delete_response.go | 158 + api/crm/crm_models/error.go | 60 + api/crm/crm_models/invalid_error.go | 121 + api/crm/crm_models/lead.go | 185 + api/crm/crm_models/lead_request.go | 116 + api/crm/crm_models/lead_response.go | 158 + api/crm/crm_models/message.go | 60 + api/crm/crm_models/pagination.go | 63 + api/crm/crm_models/request_meta.go | 75 + api/crm/crm_models/response_meta.go | 137 + .../devops_client/cluster/cluster_client.go | 258 + .../cluster/get_cluster_parameters.go | 153 + .../cluster/get_cluster_responses.go | 339 + .../get_clusters_observable_parameters.go | 130 + .../get_clusters_observable_responses.go | 337 + .../cluster/get_clusters_parameters.go | 272 + .../cluster/get_clusters_responses.go | 339 + .../cluster/post_clusters_parameters.go | 155 + .../cluster/post_clusters_responses.go | 339 + .../cluster/put_clusters_parameters.go | 155 + .../cluster/put_clusters_responses.go | 339 + .../cors/cluster_options_parameters.go | 130 + .../cors/cluster_options_responses.go | 113 + .../cors/clusters_options_parameters.go | 130 + .../cors/clusters_options_responses.go | 113 + api/devops/devops_client/cors/cors_client.go | 683 ++ .../cors/database_options_parameters.go | 130 + .../cors/database_options_responses.go | 113 + .../cors/databases_options_parameters.go | 130 + .../cors/databases_options_responses.go | 113 + .../cors/ingest_options_parameters.go | 130 + .../cors/ingest_options_responses.go | 113 + .../cors/ingests_options_parameters.go | 130 + .../cors/ingests_options_responses.go | 113 + .../cors/job_options_parameters.go | 130 + .../cors/job_options_responses.go | 113 + .../cors/jobs_options_parameters.go | 130 + .../cors/jobs_options_responses.go | 113 + .../cors/service_options_parameters.go | 130 + .../cors/service_options_responses.go | 113 + .../cors/services_options_parameters.go | 130 + .../cors/services_options_responses.go | 113 + .../cors/template_options_parameters.go | 130 + .../cors/template_options_responses.go | 113 + .../cors/templates_options_parameters.go | 130 + .../cors/templates_options_responses.go | 113 + .../cors/tenant_options_parameters.go | 130 + .../cors/tenant_options_responses.go | 113 + .../cors/tenants_options_parameters.go | 130 + .../cors/tenants_options_responses.go | 113 + .../cors/user_options_parameters.go | 130 + .../cors/user_options_responses.go | 113 + .../cors/users_options_parameters.go | 130 + .../cors/users_options_responses.go | 113 + .../devops_client/database/database_client.go | 258 + .../database/get_database_parameters.go | 153 + .../database/get_database_responses.go | 339 + .../get_databases_observable_parameters.go | 130 + .../get_databases_observable_responses.go | 337 + .../database/get_databases_parameters.go | 272 + .../database/get_databases_responses.go | 331 + .../database/post_databases_parameters.go | 155 + .../database/post_databases_responses.go | 331 + .../database/put_databases_parameters.go | 155 + .../database/put_databases_responses.go | 331 + api/devops/devops_client/devops_client.go | 156 + .../ingest/get_ingest_parameters.go | 153 + .../ingest/get_ingest_responses.go | 339 + .../get_ingests_observable_parameters.go | 130 + .../get_ingests_observable_responses.go | 337 + .../ingest/get_ingests_parameters.go | 306 + .../ingest/get_ingests_responses.go | 339 + .../devops_client/ingest/ingest_client.go | 258 + .../ingest/post_ingests_parameters.go | 155 + .../ingest/post_ingests_responses.go | 339 + .../ingest/put_ingests_parameters.go | 155 + .../ingest/put_ingests_responses.go | 339 + .../devops_client/job/get_job_parameters.go | 153 + .../devops_client/job/get_job_responses.go | 339 + .../job/get_jobs_observable_parameters.go | 130 + .../job/get_jobs_observable_responses.go | 337 + .../devops_client/job/get_jobs_parameters.go | 340 + .../devops_client/job/get_jobs_responses.go | 339 + api/devops/devops_client/job/job_client.go | 258 + .../devops_client/job/post_jobs_parameters.go | 155 + .../devops_client/job/post_jobs_responses.go | 339 + .../devops_client/job/put_jobs_parameters.go | 155 + .../devops_client/job/put_jobs_responses.go | 339 + .../service/get_service_parameters.go | 153 + .../service/get_service_responses.go | 339 + .../get_services_observable_parameters.go | 130 + .../get_services_observable_responses.go | 337 + .../service/get_services_parameters.go | 238 + .../service/get_services_responses.go | 339 + .../service/post_services_parameters.go | 155 + .../service/post_services_responses.go | 339 + .../service/put_services_parameters.go | 155 + .../service/put_services_responses.go | 339 + .../devops_client/service/service_client.go | 258 + .../template/get_template_parameters.go | 153 + .../template/get_template_responses.go | 339 + .../get_templates_observable_parameters.go | 130 + .../get_templates_observable_responses.go | 337 + .../template/get_templates_parameters.go | 340 + .../template/get_templates_responses.go | 339 + .../template/post_templates_parameters.go | 155 + .../template/post_templates_responses.go | 339 + .../devops_client/template/template_client.go | 215 + .../tenant/get_tenant_parameters.go | 153 + .../tenant/get_tenant_responses.go | 339 + .../get_tenants_observable_parameters.go | 130 + .../get_tenants_observable_responses.go | 337 + .../tenant/get_tenants_parameters.go | 306 + .../tenant/get_tenants_responses.go | 331 + .../tenant/post_tenants_parameters.go | 155 + .../tenant/post_tenants_responses.go | 331 + .../tenant/put_tenants_parameters.go | 155 + .../tenant/put_tenants_responses.go | 331 + .../devops_client/tenant/tenant_client.go | 258 + .../devops_client/user/get_user_parameters.go | 153 + .../devops_client/user/get_user_responses.go | 339 + .../user/get_users_observable_parameters.go | 130 + .../user/get_users_observable_responses.go | 337 + .../user/get_users_parameters.go | 408 + .../devops_client/user/get_users_responses.go | 339 + .../user/post_users_parameters.go | 155 + .../user/post_users_responses.go | 339 + .../user/put_users_parameters.go | 155 + .../devops_client/user/put_users_responses.go | 339 + api/devops/devops_client/user/user_client.go | 258 + api/devops/devops_models/address.go | 72 + api/devops/devops_models/cluster.go | 102 + api/devops/devops_models/cluster_request.go | 116 + api/devops/devops_models/cluster_response.go | 158 + api/devops/devops_models/database.go | 90 + api/devops/devops_models/database_request.go | 116 + api/devops/devops_models/database_response.go | 158 + api/devops/devops_models/delete_response.go | 158 + api/devops/devops_models/error.go | 60 + api/devops/devops_models/ingest.go | 446 + api/devops/devops_models/ingest_request.go | 116 + api/devops/devops_models/ingest_response.go | 158 + api/devops/devops_models/job.go | 486 + api/devops/devops_models/job_request.go | 116 + api/devops/devops_models/job_response.go | 158 + api/devops/devops_models/message.go | 60 + api/devops/devops_models/pagination.go | 63 + api/devops/devops_models/request_meta.go | 75 + api/devops/devops_models/response_meta.go | 137 + api/devops/devops_models/role.go | 78 + api/devops/devops_models/role_request.go | 116 + api/devops/devops_models/role_response.go | 158 + api/devops/devops_models/service.go | 120 + api/devops/devops_models/service_request.go | 116 + api/devops/devops_models/service_response.go | 158 + api/devops/devops_models/template.go | 100 + api/devops/devops_models/template_request.go | 116 + api/devops/devops_models/template_response.go | 158 + api/devops/devops_models/tenant.go | 255 + api/devops/devops_models/tenant_request.go | 116 + api/devops/devops_models/tenant_response.go | 158 + api/devops/devops_models/tenant_user.go | 99 + api/devops/devops_models/user.go | 376 + api/devops/devops_models/user_request.go | 116 + api/devops/devops_models/user_response.go | 158 + api/devops/devops_models/user_role.go | 90 + api/isp/isp_client/isp_client.go | 116 + .../isp_client/zone/get_zones_parameters.go | 253 + .../isp_client/zone/get_zones_responses.go | 363 + api/isp/isp_client/zone/zone_client.go | 86 + api/isp/isp_models/error.go | 60 + api/isp/isp_models/registrar.go | 87 + api/isp/isp_models/response_meta.go | 84 + api/isp/isp_models/zone.go | 102 + api/isp/isp_models/zone_response.go | 158 + .../kazoo_client/account/account_client.go | 125 + .../get_account_descendents_parameters.go | 150 + .../get_account_descendents_responses.go | 147 + .../account/get_accounts_parameters.go | 150 + .../account/get_accounts_responses.go | 147 + .../call_flow/call_flow_client.go | 84 + .../get_account_callflows_parameters.go | 150 + .../get_account_callflows_responses.go | 147 + api/kazoo/kazoo_client/cdr/cdr_client.go | 84 + .../cdr/get_account_c_d_rs_parameters.go | 203 + .../cdr/get_account_c_d_rs_responses.go | 147 + .../kazoo_client/device/device_client.go | 125 + .../device/get_account_devices_parameters.go | 150 + .../device/get_account_devices_responses.go | 147 + .../device/get_user_devices_parameters.go | 169 + .../device/get_user_devices_responses.go | 147 + .../group/get_account_groups_parameters.go | 150 + .../group/get_account_groups_responses.go | 147 + api/kazoo/kazoo_client/group/group_client.go | 84 + api/kazoo/kazoo_client/kazoo_client.go | 161 + .../media/get_account_media_parameters.go | 150 + .../media/get_account_media_responses.go | 147 + api/kazoo/kazoo_client/media/media_client.go | 84 + .../menu/get_account_menus_parameters.go | 150 + .../menu/get_account_menus_responses.go | 147 + api/kazoo/kazoo_client/menu/menu_client.go | 84 + .../get_account_numbers_parameters.go | 150 + .../get_account_numbers_responses.go | 147 + .../get_kazoo_numbers_parameters.go | 198 + .../get_kazoo_numbers_responses.go | 147 + .../phone_number/phone_number_client.go | 125 + .../get_account_time_rules_parameters.go | 150 + .../get_account_time_rules_responses.go | 147 + .../time_rule/time_rule_client.go | 84 + .../user/get_account_users_parameters.go | 150 + .../user/get_account_users_responses.go | 147 + .../user/get_account_vm_boxes_parameters.go | 150 + .../user/get_account_vm_boxes_responses.go | 147 + api/kazoo/kazoo_client/user/user_client.go | 125 + api/kazoo/kazoo_models/error.go | 60 + .../get_account_callflow_response.go | 296 + .../kazoo_models/get_account_cdr_response.go | 309 + .../get_account_descendent_response.go | 202 + .../get_account_group_response.go | 193 + .../get_account_media_response.go | 201 + .../get_account_menus_response.go | 189 + .../kazoo_models/get_account_response.go | 3070 ++++++ .../get_account_time_rule_response.go | 189 + .../kazoo_models/get_account_user_response.go | 213 + .../get_account_vm_box_response.go | 201 + api/kazoo/kazoo_models/get_device_response.go | 209 + .../kazoo_models/get_kazoo_number_response.go | 181 + api/kazoo/kazoo_models/get_number_response.go | 369 + api/stash/stash_client/stash_client.go | 116 + .../stash_pdf/post_pdfs_parameters.go | 155 + .../stash_pdf/post_pdfs_responses.go | 261 + .../stash_pdf/stash_pdf_client.go | 86 + api/stash/stash_models/document.go | 69 + api/stash/stash_models/document_response.go | 158 + api/stash/stash_models/error.go | 60 + api/stash/stash_models/new_p_d_f.go | 78 + api/stash/stash_models/p_d_f_request.go | 158 + api/stash/stash_models/request_meta.go | 75 + api/stash/stash_models/response_meta.go | 84 + .../voip_client/authority/authority_client.go | 172 + .../authority/get_authorities_parameters.go | 253 + .../authority/get_authorities_responses.go | 261 + .../authority/post_authorities_parameters.go | 155 + .../authority/post_authorities_responses.go | 261 + .../authority/put_authorities_parameters.go | 155 + .../authority/put_authorities_responses.go | 261 + .../voip_client/endpoint/endpoint_client.go | 172 + .../endpoint/get_endpoints_parameters.go | 253 + .../endpoint/get_endpoints_responses.go | 261 + .../endpoint/post_endpoints_parameters.go | 155 + .../endpoint/post_endpoints_responses.go | 261 + .../endpoint/put_endpoints_parameters.go | 155 + .../endpoint/put_endpoints_responses.go | 261 + .../voip_client/pbx/get_p_b_xes_parameters.go | 253 + .../voip_client/pbx/get_p_b_xes_responses.go | 261 + api/voip/voip_client/pbx/pbx_client.go | 172 + .../pbx/post_p_b_xes_parameters.go | 155 + .../voip_client/pbx/post_p_b_xes_responses.go | 261 + .../voip_client/pbx/put_p_b_xes_parameters.go | 155 + .../voip_client/pbx/put_p_b_xes_responses.go | 261 + .../pbx_user/get_p_b_x_users_parameters.go | 253 + .../pbx_user/get_p_b_x_users_responses.go | 261 + .../pbx_user/p_b_x_users_parameters.go | 155 + .../pbx_user/p_b_x_users_responses.go | 261 + .../voip_client/pbx_user/pbx_user_client.go | 172 + .../pbx_user/post_p_b_x_users_parameters.go | 155 + .../pbx_user/post_p_b_x_users_responses.go | 261 + .../get_phone_numbers_parameters.go | 253 + .../get_phone_numbers_responses.go | 261 + .../phone_number/phone_number_client.go | 172 + .../post_phone_numbers_parameters.go | 155 + .../post_phone_numbers_responses.go | 261 + .../put_phone_numbers_parameters.go | 155 + .../put_phone_numbers_responses.go | 261 + .../queue/get_queues_parameters.go | 253 + .../voip_client/queue/get_queues_responses.go | 261 + .../queue/post_queues_parameters.go | 155 + .../queue/post_queues_responses.go | 261 + .../queue/put_queues_parameters.go | 155 + .../voip_client/queue/put_queues_responses.go | 261 + api/voip/voip_client/queue/queue_client.go | 172 + .../vm_box/get_vm_boxes_parameters.go | 253 + .../vm_box/get_vm_boxes_responses.go | 261 + .../vm_box/post_vm_boxes_parameters.go | 155 + .../vm_box/post_vm_boxes_responses.go | 261 + .../vm_box/put_vm_boxes_parameters.go | 155 + .../vm_box/put_vm_boxes_responses.go | 261 + api/voip/voip_client/vm_box/vm_box_client.go | 172 + api/voip/voip_client/voip_client.go | 146 + api/voip/voip_models/authority.go | 141 + api/voip/voip_models/authority_request.go | 116 + api/voip/voip_models/authority_response.go | 158 + api/voip/voip_models/call_flow_action.go | 92 + api/voip/voip_models/callflow.go | 249 + api/voip/voip_models/endpoint.go | 141 + api/voip/voip_models/endpoint_request.go | 116 + api/voip/voip_models/endpoint_response.go | 158 + api/voip/voip_models/error.go | 60 + api/voip/voip_models/pbx.go | 120 + api/voip/voip_models/pbx_request.go | 116 + api/voip/voip_models/pbx_response.go | 158 + api/voip/voip_models/pbx_user.go | 108 + api/voip/voip_models/pbx_user_request.go | 116 + api/voip/voip_models/pbx_user_response.go | 158 + api/voip/voip_models/phone_number.go | 132 + api/voip/voip_models/phone_number_request.go | 116 + api/voip/voip_models/phone_number_response.go | 158 + api/voip/voip_models/queue.go | 90 + api/voip/voip_models/queue_request.go | 116 + api/voip/voip_models/queue_response.go | 158 + api/voip/voip_models/recipient.go | 134 + api/voip/voip_models/recipient_request.go | 116 + api/voip/voip_models/recipient_response.go | 158 + api/voip/voip_models/recipient_stats.go | 72 + api/voip/voip_models/response_meta.go | 84 + api/voip/voip_models/vm_box.go | 93 + api/voip/voip_models/vm_box_request.go | 116 + api/voip/voip_models/vm_box_response.go | 158 + .../workflow_client/app_log/app_log_client.go | 86 + .../app_log/post_app_logs_parameters.go | 155 + .../app_log/post_app_logs_responses.go | 315 + .../cors/app_log_options_parameters.go | 130 + .../cors/app_log_options_responses.go | 113 + .../workflow_client/cors/cors_client.go | 163 + .../cors/email_message_options_parameters.go | 130 + .../cors/email_message_options_responses.go | 113 + ...tgoing_email_message_options_parameters.go | 130 + ...utgoing_email_message_options_responses.go | 113 + .../email_message/email_message_client.go | 86 + .../get_email_messages_parameters.go | 165 + .../get_email_messages_responses.go | 315 + .../outgoing_email_message_client.go | 86 + ...post_outgoing_email_messages_parameters.go | 155 + .../post_outgoing_email_messages_responses.go | 315 + .../workflow_client/workflow_client.go | 131 + api/workflow/workflow_models/app_log.go | 84 + .../workflow_models/app_log_request.go | 158 + .../workflow_models/app_log_response.go | 158 + api/workflow/workflow_models/document.go | 233 + api/workflow/workflow_models/email_message.go | 199 + .../workflow_models/email_message_request.go | 158 + .../email_messages_response.go | 158 + api/workflow/workflow_models/error.go | 60 + api/workflow/workflow_models/headers.go | 57 + .../workflow_models/outgoing_email_message.go | 149 + .../outgoing_email_message_request.go | 158 + api/workflow/workflow_models/request_meta.go | 75 + api/workflow/workflow_models/response_meta.go | 84 + app/address.go | 20 + app/auth.go | 39 + app/config.go | 217 + app/force.go | 26 + app/logger/logger.go | 43 + app/mysql.go | 29 + app/prometheus.go | 67 + app/root.go | 50 + app/tenantuser.go | 31 + app/user-helpers.go | 134 + app/user.go | 78 + app/userrole.go | 28 + build/COPYRIGHT | 3 + go.mod | 17 + go.sum | 723 ++ swagger/auth-telnexus.yaml | 435 + swagger/cloud-telnexus.yaml | 699 ++ swagger/crm-telnexus.yaml | 1679 +++ swagger/devops-telnexus.yaml | 2802 +++++ swagger/isp-telnexus.yaml | 286 + swagger/kazoo-telnexus.yaml | 1343 +++ swagger/sf-gate-telnexus.yaml | 9169 +++++++++++++++++ swagger/stash-telnexus.yaml | 216 + swagger/voip-telnexus.yaml | 1507 +++ swagger/workflow-telnexus.yaml | 586 ++ 485 files changed, 108009 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 README.md create mode 100644 api/auth/auth_client/auth_client.go create mode 100644 api/auth/auth_client/user/get_users_parameters.go create mode 100644 api/auth/auth_client/user/get_users_responses.go create mode 100644 api/auth/auth_client/user/user_client.go create mode 100644 api/auth/auth_models/address.go create mode 100644 api/auth/auth_models/error.go create mode 100644 api/auth/auth_models/response_meta.go create mode 100644 api/auth/auth_models/tenant_user.go create mode 100644 api/auth/auth_models/user.go create mode 100644 api/auth/auth_models/user_response.go create mode 100644 api/auth/auth_models/user_role.go create mode 100644 api/cloud/cloud_client/cloud_client.go create mode 100644 api/cloud/cloud_client/cors/account_options_parameters.go create mode 100644 api/cloud/cloud_client/cors/account_options_responses.go create mode 100644 api/cloud/cloud_client/cors/cors_client.go create mode 100644 api/cloud/cloud_client/hub/delete_hub_parameters.go create mode 100644 api/cloud/cloud_client/hub/delete_hub_responses.go create mode 100644 api/cloud/cloud_client/hub/get_hubs_parameters.go create mode 100644 api/cloud/cloud_client/hub/get_hubs_responses.go create mode 100644 api/cloud/cloud_client/hub/hub_client.go create mode 100644 api/cloud/cloud_client/hub/post_hubs_parameters.go create mode 100644 api/cloud/cloud_client/hub/post_hubs_responses.go create mode 100644 api/cloud/cloud_client/hub/put_hub_parameters.go create mode 100644 api/cloud/cloud_client/hub/put_hub_responses.go create mode 100644 api/cloud/cloud_client/user/get_users_parameters.go create mode 100644 api/cloud/cloud_client/user/get_users_responses.go create mode 100644 api/cloud/cloud_client/user/user_client.go create mode 100644 api/cloud/cloud_models/address.go create mode 100644 api/cloud/cloud_models/delete_response.go create mode 100644 api/cloud/cloud_models/error.go create mode 100644 api/cloud/cloud_models/hub.go create mode 100644 api/cloud/cloud_models/hub_request.go create mode 100644 api/cloud/cloud_models/hub_response.go create mode 100644 api/cloud/cloud_models/message.go create mode 100644 api/cloud/cloud_models/response_meta.go create mode 100644 api/cloud/cloud_models/tenant_user.go create mode 100644 api/cloud/cloud_models/user.go create mode 100644 api/cloud/cloud_models/user_response.go create mode 100644 api/cloud/cloud_models/user_role.go create mode 100644 api/crm/crm_client/accounts/accounts_client.go create mode 100644 api/crm/crm_client/accounts/delete_account_parameters.go create mode 100644 api/crm/crm_client/accounts/delete_account_responses.go create mode 100644 api/crm/crm_client/accounts/get_accounts_observable_parameters.go create mode 100644 api/crm/crm_client/accounts/get_accounts_observable_responses.go create mode 100644 api/crm/crm_client/accounts/get_accounts_parameters.go create mode 100644 api/crm/crm_client/accounts/get_accounts_responses.go create mode 100644 api/crm/crm_client/accounts/post_accounts_parameters.go create mode 100644 api/crm/crm_client/accounts/post_accounts_responses.go create mode 100644 api/crm/crm_client/accounts/put_account_parameters.go create mode 100644 api/crm/crm_client/accounts/put_account_responses.go create mode 100644 api/crm/crm_client/companies/companies_client.go create mode 100644 api/crm/crm_client/companies/get_companies_observable_parameters.go create mode 100644 api/crm/crm_client/companies/get_companies_observable_responses.go create mode 100644 api/crm/crm_client/companies/get_companies_parameters.go create mode 100644 api/crm/crm_client/companies/get_companies_responses.go create mode 100644 api/crm/crm_client/companies/post_companies_parameters.go create mode 100644 api/crm/crm_client/companies/post_companies_responses.go create mode 100644 api/crm/crm_client/contacts/contacts_client.go create mode 100644 api/crm/crm_client/contacts/delete_contact_parameters.go create mode 100644 api/crm/crm_client/contacts/delete_contact_responses.go create mode 100644 api/crm/crm_client/contacts/get_contacts_observable_parameters.go create mode 100644 api/crm/crm_client/contacts/get_contacts_observable_responses.go create mode 100644 api/crm/crm_client/contacts/get_contacts_parameters.go create mode 100644 api/crm/crm_client/contacts/get_contacts_responses.go create mode 100644 api/crm/crm_client/contacts/post_contacts_parameters.go create mode 100644 api/crm/crm_client/contacts/post_contacts_responses.go create mode 100644 api/crm/crm_client/contacts/put_contacts_parameters.go create mode 100644 api/crm/crm_client/contacts/put_contacts_responses.go create mode 100644 api/crm/crm_client/cors/account_options_observable_parameters.go create mode 100644 api/crm/crm_client/cors/account_options_observable_responses.go create mode 100644 api/crm/crm_client/cors/account_options_parameters.go create mode 100644 api/crm/crm_client/cors/account_options_responses.go create mode 100644 api/crm/crm_client/cors/company_observable_options_parameters.go create mode 100644 api/crm/crm_client/cors/company_observable_options_responses.go create mode 100644 api/crm/crm_client/cors/company_options_parameters.go create mode 100644 api/crm/crm_client/cors/company_options_responses.go create mode 100644 api/crm/crm_client/cors/contact_options_observable_parameters.go create mode 100644 api/crm/crm_client/cors/contact_options_observable_responses.go create mode 100644 api/crm/crm_client/cors/contact_options_parameters.go create mode 100644 api/crm/crm_client/cors/contact_options_responses.go create mode 100644 api/crm/crm_client/cors/cors_client.go create mode 100644 api/crm/crm_client/cors/lead_options_observable_parameters.go create mode 100644 api/crm/crm_client/cors/lead_options_observable_responses.go create mode 100644 api/crm/crm_client/cors/lead_options_parameters.go create mode 100644 api/crm/crm_client/cors/lead_options_responses.go create mode 100644 api/crm/crm_client/crm_client.go create mode 100644 api/crm/crm_client/leads/delete_lead_parameters.go create mode 100644 api/crm/crm_client/leads/delete_lead_responses.go create mode 100644 api/crm/crm_client/leads/get_leads_observable_parameters.go create mode 100644 api/crm/crm_client/leads/get_leads_observable_responses.go create mode 100644 api/crm/crm_client/leads/get_leads_parameters.go create mode 100644 api/crm/crm_client/leads/get_leads_responses.go create mode 100644 api/crm/crm_client/leads/leads_client.go create mode 100644 api/crm/crm_client/leads/post_leads_parameters.go create mode 100644 api/crm/crm_client/leads/post_leads_responses.go create mode 100644 api/crm/crm_client/leads/put_leads_parameters.go create mode 100644 api/crm/crm_client/leads/put_leads_responses.go create mode 100644 api/crm/crm_models/account.go create mode 100644 api/crm/crm_models/account_basic.go create mode 100644 api/crm/crm_models/account_basic_response.go create mode 100644 api/crm/crm_models/account_request.go create mode 100644 api/crm/crm_models/account_response.go create mode 100644 api/crm/crm_models/address.go create mode 100644 api/crm/crm_models/company.go create mode 100644 api/crm/crm_models/company_request.go create mode 100644 api/crm/crm_models/company_response.go create mode 100644 api/crm/crm_models/contact.go create mode 100644 api/crm/crm_models/contact_request.go create mode 100644 api/crm/crm_models/contact_response.go create mode 100644 api/crm/crm_models/delete_response.go create mode 100644 api/crm/crm_models/error.go create mode 100644 api/crm/crm_models/invalid_error.go create mode 100644 api/crm/crm_models/lead.go create mode 100644 api/crm/crm_models/lead_request.go create mode 100644 api/crm/crm_models/lead_response.go create mode 100644 api/crm/crm_models/message.go create mode 100644 api/crm/crm_models/pagination.go create mode 100644 api/crm/crm_models/request_meta.go create mode 100644 api/crm/crm_models/response_meta.go create mode 100644 api/devops/devops_client/cluster/cluster_client.go create mode 100644 api/devops/devops_client/cluster/get_cluster_parameters.go create mode 100644 api/devops/devops_client/cluster/get_cluster_responses.go create mode 100644 api/devops/devops_client/cluster/get_clusters_observable_parameters.go create mode 100644 api/devops/devops_client/cluster/get_clusters_observable_responses.go create mode 100644 api/devops/devops_client/cluster/get_clusters_parameters.go create mode 100644 api/devops/devops_client/cluster/get_clusters_responses.go create mode 100644 api/devops/devops_client/cluster/post_clusters_parameters.go create mode 100644 api/devops/devops_client/cluster/post_clusters_responses.go create mode 100644 api/devops/devops_client/cluster/put_clusters_parameters.go create mode 100644 api/devops/devops_client/cluster/put_clusters_responses.go create mode 100644 api/devops/devops_client/cors/cluster_options_parameters.go create mode 100644 api/devops/devops_client/cors/cluster_options_responses.go create mode 100644 api/devops/devops_client/cors/clusters_options_parameters.go create mode 100644 api/devops/devops_client/cors/clusters_options_responses.go create mode 100644 api/devops/devops_client/cors/cors_client.go create mode 100644 api/devops/devops_client/cors/database_options_parameters.go create mode 100644 api/devops/devops_client/cors/database_options_responses.go create mode 100644 api/devops/devops_client/cors/databases_options_parameters.go create mode 100644 api/devops/devops_client/cors/databases_options_responses.go create mode 100644 api/devops/devops_client/cors/ingest_options_parameters.go create mode 100644 api/devops/devops_client/cors/ingest_options_responses.go create mode 100644 api/devops/devops_client/cors/ingests_options_parameters.go create mode 100644 api/devops/devops_client/cors/ingests_options_responses.go create mode 100644 api/devops/devops_client/cors/job_options_parameters.go create mode 100644 api/devops/devops_client/cors/job_options_responses.go create mode 100644 api/devops/devops_client/cors/jobs_options_parameters.go create mode 100644 api/devops/devops_client/cors/jobs_options_responses.go create mode 100644 api/devops/devops_client/cors/service_options_parameters.go create mode 100644 api/devops/devops_client/cors/service_options_responses.go create mode 100644 api/devops/devops_client/cors/services_options_parameters.go create mode 100644 api/devops/devops_client/cors/services_options_responses.go create mode 100644 api/devops/devops_client/cors/template_options_parameters.go create mode 100644 api/devops/devops_client/cors/template_options_responses.go create mode 100644 api/devops/devops_client/cors/templates_options_parameters.go create mode 100644 api/devops/devops_client/cors/templates_options_responses.go create mode 100644 api/devops/devops_client/cors/tenant_options_parameters.go create mode 100644 api/devops/devops_client/cors/tenant_options_responses.go create mode 100644 api/devops/devops_client/cors/tenants_options_parameters.go create mode 100644 api/devops/devops_client/cors/tenants_options_responses.go create mode 100644 api/devops/devops_client/cors/user_options_parameters.go create mode 100644 api/devops/devops_client/cors/user_options_responses.go create mode 100644 api/devops/devops_client/cors/users_options_parameters.go create mode 100644 api/devops/devops_client/cors/users_options_responses.go create mode 100644 api/devops/devops_client/database/database_client.go create mode 100644 api/devops/devops_client/database/get_database_parameters.go create mode 100644 api/devops/devops_client/database/get_database_responses.go create mode 100644 api/devops/devops_client/database/get_databases_observable_parameters.go create mode 100644 api/devops/devops_client/database/get_databases_observable_responses.go create mode 100644 api/devops/devops_client/database/get_databases_parameters.go create mode 100644 api/devops/devops_client/database/get_databases_responses.go create mode 100644 api/devops/devops_client/database/post_databases_parameters.go create mode 100644 api/devops/devops_client/database/post_databases_responses.go create mode 100644 api/devops/devops_client/database/put_databases_parameters.go create mode 100644 api/devops/devops_client/database/put_databases_responses.go create mode 100644 api/devops/devops_client/devops_client.go create mode 100644 api/devops/devops_client/ingest/get_ingest_parameters.go create mode 100644 api/devops/devops_client/ingest/get_ingest_responses.go create mode 100644 api/devops/devops_client/ingest/get_ingests_observable_parameters.go create mode 100644 api/devops/devops_client/ingest/get_ingests_observable_responses.go create mode 100644 api/devops/devops_client/ingest/get_ingests_parameters.go create mode 100644 api/devops/devops_client/ingest/get_ingests_responses.go create mode 100644 api/devops/devops_client/ingest/ingest_client.go create mode 100644 api/devops/devops_client/ingest/post_ingests_parameters.go create mode 100644 api/devops/devops_client/ingest/post_ingests_responses.go create mode 100644 api/devops/devops_client/ingest/put_ingests_parameters.go create mode 100644 api/devops/devops_client/ingest/put_ingests_responses.go create mode 100644 api/devops/devops_client/job/get_job_parameters.go create mode 100644 api/devops/devops_client/job/get_job_responses.go create mode 100644 api/devops/devops_client/job/get_jobs_observable_parameters.go create mode 100644 api/devops/devops_client/job/get_jobs_observable_responses.go create mode 100644 api/devops/devops_client/job/get_jobs_parameters.go create mode 100644 api/devops/devops_client/job/get_jobs_responses.go create mode 100644 api/devops/devops_client/job/job_client.go create mode 100644 api/devops/devops_client/job/post_jobs_parameters.go create mode 100644 api/devops/devops_client/job/post_jobs_responses.go create mode 100644 api/devops/devops_client/job/put_jobs_parameters.go create mode 100644 api/devops/devops_client/job/put_jobs_responses.go create mode 100644 api/devops/devops_client/service/get_service_parameters.go create mode 100644 api/devops/devops_client/service/get_service_responses.go create mode 100644 api/devops/devops_client/service/get_services_observable_parameters.go create mode 100644 api/devops/devops_client/service/get_services_observable_responses.go create mode 100644 api/devops/devops_client/service/get_services_parameters.go create mode 100644 api/devops/devops_client/service/get_services_responses.go create mode 100644 api/devops/devops_client/service/post_services_parameters.go create mode 100644 api/devops/devops_client/service/post_services_responses.go create mode 100644 api/devops/devops_client/service/put_services_parameters.go create mode 100644 api/devops/devops_client/service/put_services_responses.go create mode 100644 api/devops/devops_client/service/service_client.go create mode 100644 api/devops/devops_client/template/get_template_parameters.go create mode 100644 api/devops/devops_client/template/get_template_responses.go create mode 100644 api/devops/devops_client/template/get_templates_observable_parameters.go create mode 100644 api/devops/devops_client/template/get_templates_observable_responses.go create mode 100644 api/devops/devops_client/template/get_templates_parameters.go create mode 100644 api/devops/devops_client/template/get_templates_responses.go create mode 100644 api/devops/devops_client/template/post_templates_parameters.go create mode 100644 api/devops/devops_client/template/post_templates_responses.go create mode 100644 api/devops/devops_client/template/template_client.go create mode 100644 api/devops/devops_client/tenant/get_tenant_parameters.go create mode 100644 api/devops/devops_client/tenant/get_tenant_responses.go create mode 100644 api/devops/devops_client/tenant/get_tenants_observable_parameters.go create mode 100644 api/devops/devops_client/tenant/get_tenants_observable_responses.go create mode 100644 api/devops/devops_client/tenant/get_tenants_parameters.go create mode 100644 api/devops/devops_client/tenant/get_tenants_responses.go create mode 100644 api/devops/devops_client/tenant/post_tenants_parameters.go create mode 100644 api/devops/devops_client/tenant/post_tenants_responses.go create mode 100644 api/devops/devops_client/tenant/put_tenants_parameters.go create mode 100644 api/devops/devops_client/tenant/put_tenants_responses.go create mode 100644 api/devops/devops_client/tenant/tenant_client.go create mode 100644 api/devops/devops_client/user/get_user_parameters.go create mode 100644 api/devops/devops_client/user/get_user_responses.go create mode 100644 api/devops/devops_client/user/get_users_observable_parameters.go create mode 100644 api/devops/devops_client/user/get_users_observable_responses.go create mode 100644 api/devops/devops_client/user/get_users_parameters.go create mode 100644 api/devops/devops_client/user/get_users_responses.go create mode 100644 api/devops/devops_client/user/post_users_parameters.go create mode 100644 api/devops/devops_client/user/post_users_responses.go create mode 100644 api/devops/devops_client/user/put_users_parameters.go create mode 100644 api/devops/devops_client/user/put_users_responses.go create mode 100644 api/devops/devops_client/user/user_client.go create mode 100644 api/devops/devops_models/address.go create mode 100644 api/devops/devops_models/cluster.go create mode 100644 api/devops/devops_models/cluster_request.go create mode 100644 api/devops/devops_models/cluster_response.go create mode 100644 api/devops/devops_models/database.go create mode 100644 api/devops/devops_models/database_request.go create mode 100644 api/devops/devops_models/database_response.go create mode 100644 api/devops/devops_models/delete_response.go create mode 100644 api/devops/devops_models/error.go create mode 100644 api/devops/devops_models/ingest.go create mode 100644 api/devops/devops_models/ingest_request.go create mode 100644 api/devops/devops_models/ingest_response.go create mode 100644 api/devops/devops_models/job.go create mode 100644 api/devops/devops_models/job_request.go create mode 100644 api/devops/devops_models/job_response.go create mode 100644 api/devops/devops_models/message.go create mode 100644 api/devops/devops_models/pagination.go create mode 100644 api/devops/devops_models/request_meta.go create mode 100644 api/devops/devops_models/response_meta.go create mode 100644 api/devops/devops_models/role.go create mode 100644 api/devops/devops_models/role_request.go create mode 100644 api/devops/devops_models/role_response.go create mode 100644 api/devops/devops_models/service.go create mode 100644 api/devops/devops_models/service_request.go create mode 100644 api/devops/devops_models/service_response.go create mode 100644 api/devops/devops_models/template.go create mode 100644 api/devops/devops_models/template_request.go create mode 100644 api/devops/devops_models/template_response.go create mode 100644 api/devops/devops_models/tenant.go create mode 100644 api/devops/devops_models/tenant_request.go create mode 100644 api/devops/devops_models/tenant_response.go create mode 100644 api/devops/devops_models/tenant_user.go create mode 100644 api/devops/devops_models/user.go create mode 100644 api/devops/devops_models/user_request.go create mode 100644 api/devops/devops_models/user_response.go create mode 100644 api/devops/devops_models/user_role.go create mode 100644 api/isp/isp_client/isp_client.go create mode 100644 api/isp/isp_client/zone/get_zones_parameters.go create mode 100644 api/isp/isp_client/zone/get_zones_responses.go create mode 100644 api/isp/isp_client/zone/zone_client.go create mode 100644 api/isp/isp_models/error.go create mode 100644 api/isp/isp_models/registrar.go create mode 100644 api/isp/isp_models/response_meta.go create mode 100644 api/isp/isp_models/zone.go create mode 100644 api/isp/isp_models/zone_response.go create mode 100644 api/kazoo/kazoo_client/account/account_client.go create mode 100644 api/kazoo/kazoo_client/account/get_account_descendents_parameters.go create mode 100644 api/kazoo/kazoo_client/account/get_account_descendents_responses.go create mode 100644 api/kazoo/kazoo_client/account/get_accounts_parameters.go create mode 100644 api/kazoo/kazoo_client/account/get_accounts_responses.go create mode 100644 api/kazoo/kazoo_client/call_flow/call_flow_client.go create mode 100644 api/kazoo/kazoo_client/call_flow/get_account_callflows_parameters.go create mode 100644 api/kazoo/kazoo_client/call_flow/get_account_callflows_responses.go create mode 100644 api/kazoo/kazoo_client/cdr/cdr_client.go create mode 100644 api/kazoo/kazoo_client/cdr/get_account_c_d_rs_parameters.go create mode 100644 api/kazoo/kazoo_client/cdr/get_account_c_d_rs_responses.go create mode 100644 api/kazoo/kazoo_client/device/device_client.go create mode 100644 api/kazoo/kazoo_client/device/get_account_devices_parameters.go create mode 100644 api/kazoo/kazoo_client/device/get_account_devices_responses.go create mode 100644 api/kazoo/kazoo_client/device/get_user_devices_parameters.go create mode 100644 api/kazoo/kazoo_client/device/get_user_devices_responses.go create mode 100644 api/kazoo/kazoo_client/group/get_account_groups_parameters.go create mode 100644 api/kazoo/kazoo_client/group/get_account_groups_responses.go create mode 100644 api/kazoo/kazoo_client/group/group_client.go create mode 100644 api/kazoo/kazoo_client/kazoo_client.go create mode 100644 api/kazoo/kazoo_client/media/get_account_media_parameters.go create mode 100644 api/kazoo/kazoo_client/media/get_account_media_responses.go create mode 100644 api/kazoo/kazoo_client/media/media_client.go create mode 100644 api/kazoo/kazoo_client/menu/get_account_menus_parameters.go create mode 100644 api/kazoo/kazoo_client/menu/get_account_menus_responses.go create mode 100644 api/kazoo/kazoo_client/menu/menu_client.go create mode 100644 api/kazoo/kazoo_client/phone_number/get_account_numbers_parameters.go create mode 100644 api/kazoo/kazoo_client/phone_number/get_account_numbers_responses.go create mode 100644 api/kazoo/kazoo_client/phone_number/get_kazoo_numbers_parameters.go create mode 100644 api/kazoo/kazoo_client/phone_number/get_kazoo_numbers_responses.go create mode 100644 api/kazoo/kazoo_client/phone_number/phone_number_client.go create mode 100644 api/kazoo/kazoo_client/time_rule/get_account_time_rules_parameters.go create mode 100644 api/kazoo/kazoo_client/time_rule/get_account_time_rules_responses.go create mode 100644 api/kazoo/kazoo_client/time_rule/time_rule_client.go create mode 100644 api/kazoo/kazoo_client/user/get_account_users_parameters.go create mode 100644 api/kazoo/kazoo_client/user/get_account_users_responses.go create mode 100644 api/kazoo/kazoo_client/user/get_account_vm_boxes_parameters.go create mode 100644 api/kazoo/kazoo_client/user/get_account_vm_boxes_responses.go create mode 100644 api/kazoo/kazoo_client/user/user_client.go create mode 100644 api/kazoo/kazoo_models/error.go create mode 100644 api/kazoo/kazoo_models/get_account_callflow_response.go create mode 100644 api/kazoo/kazoo_models/get_account_cdr_response.go create mode 100644 api/kazoo/kazoo_models/get_account_descendent_response.go create mode 100644 api/kazoo/kazoo_models/get_account_group_response.go create mode 100644 api/kazoo/kazoo_models/get_account_media_response.go create mode 100644 api/kazoo/kazoo_models/get_account_menus_response.go create mode 100644 api/kazoo/kazoo_models/get_account_response.go create mode 100644 api/kazoo/kazoo_models/get_account_time_rule_response.go create mode 100644 api/kazoo/kazoo_models/get_account_user_response.go create mode 100644 api/kazoo/kazoo_models/get_account_vm_box_response.go create mode 100644 api/kazoo/kazoo_models/get_device_response.go create mode 100644 api/kazoo/kazoo_models/get_kazoo_number_response.go create mode 100644 api/kazoo/kazoo_models/get_number_response.go create mode 100644 api/stash/stash_client/stash_client.go create mode 100644 api/stash/stash_client/stash_pdf/post_pdfs_parameters.go create mode 100644 api/stash/stash_client/stash_pdf/post_pdfs_responses.go create mode 100644 api/stash/stash_client/stash_pdf/stash_pdf_client.go create mode 100644 api/stash/stash_models/document.go create mode 100644 api/stash/stash_models/document_response.go create mode 100644 api/stash/stash_models/error.go create mode 100644 api/stash/stash_models/new_p_d_f.go create mode 100644 api/stash/stash_models/p_d_f_request.go create mode 100644 api/stash/stash_models/request_meta.go create mode 100644 api/stash/stash_models/response_meta.go create mode 100644 api/voip/voip_client/authority/authority_client.go create mode 100644 api/voip/voip_client/authority/get_authorities_parameters.go create mode 100644 api/voip/voip_client/authority/get_authorities_responses.go create mode 100644 api/voip/voip_client/authority/post_authorities_parameters.go create mode 100644 api/voip/voip_client/authority/post_authorities_responses.go create mode 100644 api/voip/voip_client/authority/put_authorities_parameters.go create mode 100644 api/voip/voip_client/authority/put_authorities_responses.go create mode 100644 api/voip/voip_client/endpoint/endpoint_client.go create mode 100644 api/voip/voip_client/endpoint/get_endpoints_parameters.go create mode 100644 api/voip/voip_client/endpoint/get_endpoints_responses.go create mode 100644 api/voip/voip_client/endpoint/post_endpoints_parameters.go create mode 100644 api/voip/voip_client/endpoint/post_endpoints_responses.go create mode 100644 api/voip/voip_client/endpoint/put_endpoints_parameters.go create mode 100644 api/voip/voip_client/endpoint/put_endpoints_responses.go create mode 100644 api/voip/voip_client/pbx/get_p_b_xes_parameters.go create mode 100644 api/voip/voip_client/pbx/get_p_b_xes_responses.go create mode 100644 api/voip/voip_client/pbx/pbx_client.go create mode 100644 api/voip/voip_client/pbx/post_p_b_xes_parameters.go create mode 100644 api/voip/voip_client/pbx/post_p_b_xes_responses.go create mode 100644 api/voip/voip_client/pbx/put_p_b_xes_parameters.go create mode 100644 api/voip/voip_client/pbx/put_p_b_xes_responses.go create mode 100644 api/voip/voip_client/pbx_user/get_p_b_x_users_parameters.go create mode 100644 api/voip/voip_client/pbx_user/get_p_b_x_users_responses.go create mode 100644 api/voip/voip_client/pbx_user/p_b_x_users_parameters.go create mode 100644 api/voip/voip_client/pbx_user/p_b_x_users_responses.go create mode 100644 api/voip/voip_client/pbx_user/pbx_user_client.go create mode 100644 api/voip/voip_client/pbx_user/post_p_b_x_users_parameters.go create mode 100644 api/voip/voip_client/pbx_user/post_p_b_x_users_responses.go create mode 100644 api/voip/voip_client/phone_number/get_phone_numbers_parameters.go create mode 100644 api/voip/voip_client/phone_number/get_phone_numbers_responses.go create mode 100644 api/voip/voip_client/phone_number/phone_number_client.go create mode 100644 api/voip/voip_client/phone_number/post_phone_numbers_parameters.go create mode 100644 api/voip/voip_client/phone_number/post_phone_numbers_responses.go create mode 100644 api/voip/voip_client/phone_number/put_phone_numbers_parameters.go create mode 100644 api/voip/voip_client/phone_number/put_phone_numbers_responses.go create mode 100644 api/voip/voip_client/queue/get_queues_parameters.go create mode 100644 api/voip/voip_client/queue/get_queues_responses.go create mode 100644 api/voip/voip_client/queue/post_queues_parameters.go create mode 100644 api/voip/voip_client/queue/post_queues_responses.go create mode 100644 api/voip/voip_client/queue/put_queues_parameters.go create mode 100644 api/voip/voip_client/queue/put_queues_responses.go create mode 100644 api/voip/voip_client/queue/queue_client.go create mode 100644 api/voip/voip_client/vm_box/get_vm_boxes_parameters.go create mode 100644 api/voip/voip_client/vm_box/get_vm_boxes_responses.go create mode 100644 api/voip/voip_client/vm_box/post_vm_boxes_parameters.go create mode 100644 api/voip/voip_client/vm_box/post_vm_boxes_responses.go create mode 100644 api/voip/voip_client/vm_box/put_vm_boxes_parameters.go create mode 100644 api/voip/voip_client/vm_box/put_vm_boxes_responses.go create mode 100644 api/voip/voip_client/vm_box/vm_box_client.go create mode 100644 api/voip/voip_client/voip_client.go create mode 100644 api/voip/voip_models/authority.go create mode 100644 api/voip/voip_models/authority_request.go create mode 100644 api/voip/voip_models/authority_response.go create mode 100644 api/voip/voip_models/call_flow_action.go create mode 100644 api/voip/voip_models/callflow.go create mode 100644 api/voip/voip_models/endpoint.go create mode 100644 api/voip/voip_models/endpoint_request.go create mode 100644 api/voip/voip_models/endpoint_response.go create mode 100644 api/voip/voip_models/error.go create mode 100644 api/voip/voip_models/pbx.go create mode 100644 api/voip/voip_models/pbx_request.go create mode 100644 api/voip/voip_models/pbx_response.go create mode 100644 api/voip/voip_models/pbx_user.go create mode 100644 api/voip/voip_models/pbx_user_request.go create mode 100644 api/voip/voip_models/pbx_user_response.go create mode 100644 api/voip/voip_models/phone_number.go create mode 100644 api/voip/voip_models/phone_number_request.go create mode 100644 api/voip/voip_models/phone_number_response.go create mode 100644 api/voip/voip_models/queue.go create mode 100644 api/voip/voip_models/queue_request.go create mode 100644 api/voip/voip_models/queue_response.go create mode 100644 api/voip/voip_models/recipient.go create mode 100644 api/voip/voip_models/recipient_request.go create mode 100644 api/voip/voip_models/recipient_response.go create mode 100644 api/voip/voip_models/recipient_stats.go create mode 100644 api/voip/voip_models/response_meta.go create mode 100644 api/voip/voip_models/vm_box.go create mode 100644 api/voip/voip_models/vm_box_request.go create mode 100644 api/voip/voip_models/vm_box_response.go create mode 100644 api/workflow/workflow_client/app_log/app_log_client.go create mode 100644 api/workflow/workflow_client/app_log/post_app_logs_parameters.go create mode 100644 api/workflow/workflow_client/app_log/post_app_logs_responses.go create mode 100644 api/workflow/workflow_client/cors/app_log_options_parameters.go create mode 100644 api/workflow/workflow_client/cors/app_log_options_responses.go create mode 100644 api/workflow/workflow_client/cors/cors_client.go create mode 100644 api/workflow/workflow_client/cors/email_message_options_parameters.go create mode 100644 api/workflow/workflow_client/cors/email_message_options_responses.go create mode 100644 api/workflow/workflow_client/cors/outgoing_email_message_options_parameters.go create mode 100644 api/workflow/workflow_client/cors/outgoing_email_message_options_responses.go create mode 100644 api/workflow/workflow_client/email_message/email_message_client.go create mode 100644 api/workflow/workflow_client/email_message/get_email_messages_parameters.go create mode 100644 api/workflow/workflow_client/email_message/get_email_messages_responses.go create mode 100644 api/workflow/workflow_client/outgoing_email_message/outgoing_email_message_client.go create mode 100644 api/workflow/workflow_client/outgoing_email_message/post_outgoing_email_messages_parameters.go create mode 100644 api/workflow/workflow_client/outgoing_email_message/post_outgoing_email_messages_responses.go create mode 100644 api/workflow/workflow_client/workflow_client.go create mode 100644 api/workflow/workflow_models/app_log.go create mode 100644 api/workflow/workflow_models/app_log_request.go create mode 100644 api/workflow/workflow_models/app_log_response.go create mode 100644 api/workflow/workflow_models/document.go create mode 100644 api/workflow/workflow_models/email_message.go create mode 100644 api/workflow/workflow_models/email_message_request.go create mode 100644 api/workflow/workflow_models/email_messages_response.go create mode 100644 api/workflow/workflow_models/error.go create mode 100644 api/workflow/workflow_models/headers.go create mode 100644 api/workflow/workflow_models/outgoing_email_message.go create mode 100644 api/workflow/workflow_models/outgoing_email_message_request.go create mode 100644 api/workflow/workflow_models/request_meta.go create mode 100644 api/workflow/workflow_models/response_meta.go create mode 100644 app/address.go create mode 100644 app/auth.go create mode 100644 app/config.go create mode 100644 app/force.go create mode 100644 app/logger/logger.go create mode 100644 app/mysql.go create mode 100644 app/prometheus.go create mode 100644 app/root.go create mode 100644 app/tenantuser.go create mode 100644 app/user-helpers.go create mode 100644 app/user.go create mode 100644 app/userrole.go create mode 100644 build/COPYRIGHT create mode 100644 go.mod create mode 100644 go.sum create mode 100644 swagger/auth-telnexus.yaml create mode 100644 swagger/cloud-telnexus.yaml create mode 100644 swagger/crm-telnexus.yaml create mode 100644 swagger/devops-telnexus.yaml create mode 100644 swagger/isp-telnexus.yaml create mode 100644 swagger/kazoo-telnexus.yaml create mode 100644 swagger/sf-gate-telnexus.yaml create mode 100644 swagger/stash-telnexus.yaml create mode 100644 swagger/voip-telnexus.yaml create mode 100644 swagger/workflow-telnexus.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e88a88c --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, build with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out +*.log +/swagger/docs/* +/.sfdx/* +/swagger/apex/* +/swagger/mysql/* +/swagger/logs/* +/swagger/graphql/* + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..87ffe4d --- /dev/null +++ b/Makefile @@ -0,0 +1,140 @@ +TELNEXUS_BUILD_ENV ?= dev +TELNEXUS_GELF_URI ?= udp://packrat.noc.tnxs.net:12201 +TELNEXUS_REGISTRY_PRIV ?= hub.tnxs.net +TELNEXUS_REGISTRY_PUB ?= docker.io +TELNEXUS_REPO_NAME = lib +TELNEXUS_VERSION ?= 0.0.1 + +.PHONY: swagger + +swagger: + rm -rf api + # + # generate auth0 client + # + mkdir -p lib/auth0 + swagger generate client \ + --log-output=./swagger/logs/generate-auth0-client.log \ + --copyright-file=./build/COPYRIGHT \ + --name=auth0 \ + --spec=./swagger/auth0.yaml \ + --target=./lib/auth0 \ + --client-package=auth0-client \ + --model-package=auth0-models + # + # generate auth client + # + mkdir api/auth + swagger-new generate client \ + --log-output=./swagger/logs/generate-auth-client.log \ + --copyright-file=./build/COPYRIGHT \ + --name=auth \ + --spec=./swagger/auth-telnexus.yaml \ + --target=./api/auth \ + --client-package=auth-client \ + --model-package=auth-models \ + --principal=app.User + # + # generate cloud client + # + mkdir api/cloud + swagger-new generate client \ + --log-output=./swagger/logs/generate-cloud-client.log \ + --copyright-file=./build/COPYRIGHT \ + --name=cloud \ + --spec=./swagger/cloud-telnexus.yaml \ + --target=./api/cloud \ + --client-package=cloud-client \ + --model-package=cloud-models \ + --principal=app.User + # + # generate crm client + # + mkdir api/crm + swagger-new generate client \ + --log-output=./swagger/logs/generate-crm-client.log \ + --copyright-file=./build/COPYRIGHT \ + --name=crm \ + --spec=./swagger/crm-telnexus.yaml \ + --target=./api/crm \ + --client-package=crm-client \ + --model-package=crm-models \ + --principal=app.User + # + # generate devops client + # + mkdir api/devops + swagger-new generate client \ + --log-output=./swagger/logs/generate-devops-client.log \ + --copyright-file=./build/COPYRIGHT \ + --name=devops \ + --spec=./swagger/devops-telnexus.yaml \ + --target=./api/devops \ + --client-package=devops-client \ + --model-package=devops-models \ + --principal=app.User + # + # generate isp client + # + mkdir api/isp + swagger-new generate client \ + --log-output=./swagger/logs/generate-isp-client.log \ + --copyright-file=./build/COPYRIGHT \ + --name=isp \ + --spec=./swagger/isp-telnexus.yaml \ + --target=./api/isp \ + --client-package=isp-client \ + --model-package=isp-models \ + --principal=app.User + # + # generate kazoo client + # + mkdir api/kazoo + swagger-new generate client \ + --log-output=./swagger/logs/generate-kazoo-client.log \ + --copyright-file=./build/COPYRIGHT \ + --name=kazoo \ + --spec=./swagger/kazoo-telnexus.yaml \ + --target=./api/kazoo \ + --client-package=kazoo-client \ + --model-package=kazoo-models \ + --principal=app.User + # + # generate stash client + # + mkdir api/stash + swagger-new generate client \ + --log-output=./swagger/logs/generate-stash-client.log \ + --copyright-file=./build/COPYRIGHT \ + --name=stash \ + --spec=./swagger/stash-telnexus.yaml \ + --target=./api/stash \ + --client-package=stash-client \ + --model-package=stash-models \ + --principal=app.User + # + # generate voip client + # + mkdir api/voip + swagger-new generate client \ + --log-output=./swagger/logs/generate-voip-client.log \ + --copyright-file=./build/COPYRIGHT \ + --name=voip \ + --spec=./swagger/voip-telnexus.yaml \ + --target=./api/voip \ + --client-package=voip-client \ + --model-package=voip-models \ + --principal=app.User + # + # generate workflow client + # + mkdir api/workflow + swagger-new generate client \ + --log-output=./swagger/logs/generate-workflow-client.log \ + --copyright-file=./build/COPYRIGHT \ + --name=workflow \ + --spec=./swagger/workflow-telnexus.yaml \ + --target=./api/workflow \ + --client-package=workflow-client \ + --model-package=workflow-models \ + --principal=app.User diff --git a/README.md b/README.md new file mode 100644 index 0000000..4222f40 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# lib + +Telnexus Shared Libraries (go) diff --git a/api/auth/auth_client/auth_client.go b/api/auth/auth_client/auth_client.go new file mode 100644 index 0000000..33b0adb --- /dev/null +++ b/api/auth/auth_client/auth_client.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/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 string = "auth.infra.tnxs.net:8080" + // 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 +var DefaultSchemes = []string{"http"} + +// NewHTTPClient creates a new auth HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Auth { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new auth HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Auth { + // ensure nullable parameters have default + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new auth client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Auth { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Auth) + cli.Transport = transport + cli.User = user.New(transport, formats) + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// Auth is a client for auth +type Auth struct { + User user.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Auth) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.User.SetTransport(transport) +} diff --git a/api/auth/auth_client/user/get_users_parameters.go b/api/auth/auth_client/user/get_users_parameters.go new file mode 100644 index 0000000..b24a54c --- /dev/null +++ b/api/auth/auth_client/user/get_users_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetUsersParams creates a new GetUsersParams 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 NewGetUsersParams() *GetUsersParams { + return &GetUsersParams{ + timeout: 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, + } +} + +// NewGetUsersParamsWithContext creates a new GetUsersParams object +// with the ability to set a context for a request. +func NewGetUsersParamsWithContext(ctx context.Context) *GetUsersParams { + return &GetUsersParams{ + Context: ctx, + } +} + +// NewGetUsersParamsWithHTTPClient creates a new GetUsersParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetUsersParamsWithHTTPClient(client *http.Client) *GetUsersParams { + return &GetUsersParams{ + HTTPClient: client, + } +} + +/* GetUsersParams contains all the parameters to send to the API endpoint + for the get users operation. + + Typically these are written to a http.Request. +*/ +type GetUsersParams struct { + + /* Apikey. + + Service account or developer API key + */ + Apikey *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetUsersParams) WithDefaults() *GetUsersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetUsersParams) SetDefaults() { + // no default values defined for this parameter +} + +// 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 +func (o *GetUsersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get users params +func (o *GetUsersParams) WithContext(ctx context.Context) *GetUsersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get users params +func (o *GetUsersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// 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 +func (o *GetUsersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// 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 +func (o *GetUsersParams) SetApikey(apikey *string) { + o.Apikey = apikey +} + +// WriteToRequest writes these params to a swagger request +func (o *GetUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Apikey != nil { + + // query param apikey + var qrApikey string + + if o.Apikey != nil { + qrApikey = *o.Apikey + } + qApikey := qrApikey + if qApikey != "" { + + if err := r.SetQueryParam("apikey", qApikey); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/auth/auth_client/user/get_users_responses.go b/api/auth/auth_client/user/get_users_responses.go new file mode 100644 index 0000000..d8afa69 --- /dev/null +++ b/api/auth/auth_client/user/get_users_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/auth/auth_models" +) + +// GetUsersReader is a Reader for the GetUsers structure. +type GetUsersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetUsersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetUsersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetUsersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetUsersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetUsersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetUsersInternalServerError() + 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()) + } +} + +// NewGetUsersOK creates a GetUsersOK with default headers values +func NewGetUsersOK() *GetUsersOK { + return &GetUsersOK{} +} + +/* GetUsersOK describes a response with status code 200, with default header values. + +Telnexus Response with User objects +*/ +type GetUsersOK struct { + Payload *auth_models.UserResponse +} + +func (o *GetUsersOK) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersOK %+v", 200, o.Payload) +} +func (o *GetUsersOK) GetPayload() *auth_models.UserResponse { + return o.Payload +} + +func (o *GetUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth_models.UserResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUsersUnauthorized creates a GetUsersUnauthorized with default headers values +func NewGetUsersUnauthorized() *GetUsersUnauthorized { + return &GetUsersUnauthorized{} +} + +/* 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 +} + +func (o *GetUsersUnauthorized) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersUnauthorized %+v", 401, o.Payload) +} +func (o *GetUsersUnauthorized) GetPayload() *auth_models.Error { + return o.Payload +} + +func (o *GetUsersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUsersForbidden creates a GetUsersForbidden with default headers values +func NewGetUsersForbidden() *GetUsersForbidden { + return &GetUsersForbidden{} +} + +/* GetUsersForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetUsersForbidden struct { + Payload *auth_models.Error +} + +func (o *GetUsersForbidden) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersForbidden %+v", 403, o.Payload) +} +func (o *GetUsersForbidden) GetPayload() *auth_models.Error { + return o.Payload +} + +func (o *GetUsersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUsersNotFound creates a GetUsersNotFound with default headers values +func NewGetUsersNotFound() *GetUsersNotFound { + return &GetUsersNotFound{} +} + +/* GetUsersNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetUsersNotFound struct { + Payload *auth_models.Error +} + +func (o *GetUsersNotFound) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersNotFound %+v", 404, o.Payload) +} +func (o *GetUsersNotFound) GetPayload() *auth_models.Error { + return o.Payload +} + +func (o *GetUsersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUsersUnprocessableEntity creates a GetUsersUnprocessableEntity with default headers values +func NewGetUsersUnprocessableEntity() *GetUsersUnprocessableEntity { + return &GetUsersUnprocessableEntity{} +} + +/* 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 +} + +func (o *GetUsersUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetUsersUnprocessableEntity) GetPayload() *auth_models.Error { + return o.Payload +} + +func (o *GetUsersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUsersInternalServerError creates a GetUsersInternalServerError with default headers values +func NewGetUsersInternalServerError() *GetUsersInternalServerError { + return &GetUsersInternalServerError{} +} + +/* GetUsersInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetUsersInternalServerError struct { + Payload *auth_models.Error +} + +func (o *GetUsersInternalServerError) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersInternalServerError %+v", 500, o.Payload) +} +func (o *GetUsersInternalServerError) GetPayload() *auth_models.Error { + return o.Payload +} + +func (o *GetUsersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/auth/auth_client/user/user_client.go b/api/auth/auth_client/user/user_client.go new file mode 100644 index 0000000..3d1a6e1 --- /dev/null +++ b/api/auth/auth_client/user/user_client.go @@ -0,0 +1,86 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new user API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for user 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 { + GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUsersOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetUsers checks API key + + Checks for a valid API key, and returns full user record +*/ +func (a *Client) GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUsersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetUsersParams() + } + op := &runtime.ClientOperation{ + ID: "getUsers", + Method: "GET", + PathPattern: "/users", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + 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) + if err != nil { + return nil, err + } + 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 + 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) { + a.transport = transport +} diff --git a/api/auth/auth_models/address.go b/api/auth/auth_models/address.go new file mode 100644 index 0000000..0d3985b --- /dev/null +++ b/api/auth/auth_models/address.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" +) + +// Address address +// +// swagger:model Address +type Address struct { + + // City + City string `json:"City,omitempty"` + + // Country full name + Country string `json:"Country,omitempty"` + + // Country Code + CountryCode string `json:"CountryCode,omitempty"` + + // Postal Code + PostalCode string `json:"PostalCode,omitempty"` + + // State full name + State string `json:"State,omitempty"` + + // State Code + StateCode string `json:"StateCode,omitempty"` + + // Street number and name + Street string `json:"Street,omitempty"` +} + +// Validate validates this address +func (m *Address) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this address based on context it is used +func (m *Address) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Address) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Address) UnmarshalBinary(b []byte) error { + var res Address + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/auth/auth_models/error.go b/api/auth/auth_models/error.go new file mode 100644 index 0000000..d293386 --- /dev/null +++ b/api/auth/auth_models/error.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" +) + +// Error error +// +// swagger:model Error +type Error struct { + + // code + Code int32 `json:"Code,omitempty"` + + // fields + Fields string `json:"Fields,omitempty"` + + // message + Message string `json:"Message,omitempty"` +} + +// Validate validates this error +func (m *Error) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this error based on context it is used +func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Error) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Error) UnmarshalBinary(b []byte) error { + var res Error + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/auth/auth_models/response_meta.go b/api/auth/auth_models/response_meta.go new file mode 100644 index 0000000..81ed986 --- /dev/null +++ b/api/auth/auth_models/response_meta.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" +) + +// ResponseMeta response meta +// +// swagger:model ResponseMeta +type ResponseMeta struct { + + // Microservice Contact Info + Contact string `json:"Contact,omitempty"` + + // Copyright Info + Copyright string `json:"Copyright,omitempty"` + + // License Information and Restrictions + License string `json:"License,omitempty"` + + // Operation ID + OperationID string `json:"OperationID,omitempty"` + + // Request IP Address + RequestIP string `json:"RequestIP,omitempty"` + + // Request Type + RequestType string `json:"RequestType,omitempty"` + + // Request URL + RequestURL string `json:"RequestURL,omitempty"` + + // Data Server Info + ServerInfo string `json:"ServerInfo,omitempty"` + + // Data Server Response Time (ms) + ServerResponseTime string `json:"ServerResponseTime,omitempty"` + + // Backend Server Timestamp + ServerTimestamp string `json:"ServerTimestamp,omitempty"` + + // Telnexus Account Number used for recording transactions + TelnexusAccount string `json:"TelnexusAccount,omitempty"` +} + +// Validate validates this response meta +func (m *ResponseMeta) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this response meta based on context it is used +func (m *ResponseMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ResponseMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ResponseMeta) UnmarshalBinary(b []byte) error { + var res ResponseMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/auth/auth_models/tenant_user.go b/api/auth/auth_models/tenant_user.go new file mode 100644 index 0000000..a6348ea --- /dev/null +++ b/api/auth/auth_models/tenant_user.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" +) + +// TenantUser Relationship object that connects users to a tenant +// +// swagger:model TenantUser +type TenantUser struct { + + // The makeTenantUser access level for this User + AccessLevel string `json:"AccessLevel,omitempty"` + + // Account ID + AccountID string `json:"AccountID,omitempty"` + + // Auth0 User ID + Auth0UserID string `json:"Auth0UserID,omitempty"` + + // Account Name + CompanyName string `json:"CompanyName,omitempty"` + + // Contact ID + ContactID string `json:"ContactID,omitempty"` + + // Telnexus Account + TelnexusAccount string `json:"TelnexusAccount,omitempty"` + + // Tenant active? + TenantActive bool `json:"TenantActive,omitempty"` + + // The Tenant ID + TenantID string `json:"TenantID,omitempty"` + + // Tenant Name + TenantName string `json:"TenantName,omitempty"` + + // Tenant Status + TenantStatus string `json:"TenantStatus,omitempty"` + + // Tenant type + TenantType string `json:"TenantType,omitempty"` + + // Tenant Version + TenantVersion string `json:"TenantVersion,omitempty"` + + // User Email Address + UserEmail string `json:"UserEmail,omitempty"` + + // User Full Name + UserFullName string `json:"UserFullName,omitempty"` + + // The User ID + UserID string `json:"UserID,omitempty"` + + // Username + Username string `json:"Username,omitempty"` +} + +// Validate validates this tenant user +func (m *TenantUser) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this tenant user based on context it is used +func (m *TenantUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TenantUser) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TenantUser) UnmarshalBinary(b []byte) error { + var res TenantUser + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/auth/auth_models/user.go b/api/auth/auth_models/user.go new file mode 100644 index 0000000..75a1585 --- /dev/null +++ b/api/auth/auth_models/user.go @@ -0,0 +1,376 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// User user +// +// swagger:model User +type User struct { + + // API Key + APIKey string `json:"APIKey,omitempty"` + + // About Me + AboutMe string `json:"AboutMe,omitempty"` + + // Account ID + AccountID string `json:"AccountID,omitempty"` + + // address + Address *Address `json:"Address,omitempty"` + + // Alias + Alias string `json:"Alias,omitempty"` + + // Auth0 User Id + Auth0UserID string `json:"Auth0UserID,omitempty"` + + // Nickname + CommunityNickname string `json:"CommunityNickname,omitempty"` + + // Company Name + CompanyName string `json:"CompanyName,omitempty"` + + // Contact + ContactID string `json:"ContactID,omitempty"` + + // Created User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Date Created + CreatedDate string `json:"CreatedDate,omitempty"` + + // Delegated Approver + DelegatedApproverID string `json:"DelegatedApproverID,omitempty"` + + // Department + Department string `json:"Department,omitempty"` + + // Division + Division string `json:"Division,omitempty"` + + // Email address + Email string `json:"Email,omitempty"` + + // Employee Number + EmployeeNumber string `json:"EmployeeNumber,omitempty"` + + // Time day ends + EndOfDay string `json:"EndOfDay,omitempty"` + + // Environment + Environment string `json:"Environment,omitempty"` + + // Extension + Extension string `json:"Extension,omitempty"` + + // Fabric API Key + FabricAPIKey string `json:"FabricAPIKey,omitempty"` + + // Fax + Fax string `json:"Fax,omitempty"` + + // The first name + FirstName string `json:"FirstName,omitempty"` + + // Allow Forecasting + ForecastEnabled bool `json:"ForecastEnabled,omitempty"` + + // Full Photo URL + FullPhotoURL string `json:"FullPhotoURL,omitempty"` + + // Telnexus ID + ID string `json:"ID,omitempty"` + + // Active + IsActive bool `json:"IsActive,omitempty"` + + // Is the user enabled for Communities? + IsPortalEnabled bool `json:"IsPortalEnabled,omitempty"` + + // Has Profile Photo + IsProphilePhotoActive bool `json:"IsProphilePhotoActive,omitempty"` + + // is system controlled + IsSystemControlled bool `json:"IsSystemControlled,omitempty"` + + // IP address of last login + LastIP string `json:"LastIP,omitempty"` + + // Last login time + LastLogin string `json:"LastLogin,omitempty"` + + // Last Modified User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // The Last Name + LastName string `json:"LastName,omitempty"` + + // Number of times user has logged in + LoginCount int64 `json:"LoginCount,omitempty"` + + // Manager + ManagerID string `json:"ManagerID,omitempty"` + + // Mobile + MobilePhone string `json:"MobilePhone,omitempty"` + + // Name + Name string `json:"Name,omitempty"` + + // Out of office message + OutOfOfficeMessage string `json:"OutOfOfficeMessage,omitempty"` + + // Phone + Phone string `json:"Phone,omitempty"` + + // Portal Role Level + PortalRole string `json:"PortalRole,omitempty"` + + // Profile + ProfileID string `json:"ProfileID,omitempty"` + + // Info Emails + ReceivesAdminEmails bool `json:"ReceivesAdminEmails,omitempty"` + + // Admin Info Emails + ReceivesAdminInfoEmails bool `json:"ReceivesAdminInfoEmails,omitempty"` + + // Email Sender Address + SenderEmail string `json:"SenderEmail,omitempty"` + + // Email Sender Name + SenderName string `json:"SenderName,omitempty"` + + // Email Signature + Signature string `json:"Signature,omitempty"` + + // Small Photo URL + SmallPhotoURL string `json:"SmallPhotoURL,omitempty"` + + // The time day starts + StartOfDay string `json:"StartOfDay,omitempty"` + + // Telnexus Account + TelnexusAccount string `json:"TelnexusAccount,omitempty"` + + // Tenant ID associated with this user + TenantID string `json:"TenantID,omitempty"` + + // tenant users + TenantUsers []*TenantUser `json:"TenantUsers"` + + // Time Zone + TimeZone string `json:"TimeZone,omitempty"` + + // Title + Title string `json:"Title,omitempty"` + + // Role + UserRoleID string `json:"UserRoleID,omitempty"` + + // user roles + UserRoles []*UserRole `json:"UserRoles"` + + // User Type + UserType string `json:"UserType,omitempty"` + + // Username + Username string `json:"Username,omitempty"` +} + +// Validate validates this user +func (m *User) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTenantUsers(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUserRoles(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *User) validateAddress(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Address") + } + return err + } + } + + return nil +} + +func (m *User) validateTenantUsers(formats strfmt.Registry) error { + if swag.IsZero(m.TenantUsers) { // not required + return nil + } + + for i := 0; i < len(m.TenantUsers); i++ { + if swag.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 { + return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *User) validateUserRoles(formats strfmt.Registry) error { + if swag.IsZero(m.UserRoles) { // not required + return nil + } + + for i := 0; i < len(m.UserRoles); i++ { + if swag.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 { + return ve.ValidateName("UserRoles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this user based on the context it is used +func (m *User) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTenantUsers(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUserRoles(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *User) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.Address != nil { + if err := m.Address.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Address") + } + return err + } + } + + return nil +} + +func (m *User) contextValidateTenantUsers(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TenantUsers); i++ { + + if m.TenantUsers[i] != nil { + if err := m.TenantUsers[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *User) contextValidateUserRoles(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.UserRoles); i++ { + + if m.UserRoles[i] != nil { + if err := m.UserRoles[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("UserRoles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *User) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *User) UnmarshalBinary(b []byte) error { + var res User + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/auth/auth_models/user_response.go b/api/auth/auth_models/user_response.go new file mode 100644 index 0000000..57bbcc5 --- /dev/null +++ b/api/auth/auth_models/user_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UserResponse An array Telnexus user objects +// +// swagger:model UserResponse +type UserResponse struct { + + // data + Data []*User `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this user response +func (m *UserResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UserResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UserResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this user response based on the context it is used +func (m *UserResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UserResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UserResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UserResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UserResponse) UnmarshalBinary(b []byte) error { + var res UserResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/auth/auth_models/user_role.go b/api/auth/auth_models/user_role.go new file mode 100644 index 0000000..bdc196b --- /dev/null +++ b/api/auth/auth_models/user_role.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" +) + +// UserRole Relationship object that connects user to a role +// +// swagger:model UserRole +type UserRole struct { + + // Account Id + AccountID string `json:"AccountID,omitempty"` + + // Linked role ID + Auth0RoleID string `json:"Auth0RoleID,omitempty"` + + // Auth0 User ID + Auth0UserID string `json:"Auth0UserID,omitempty"` + + // Company Name + CompanyName string `json:"CompanyName,omitempty"` + + // Contact ID + ContactID string `json:"ContactID,omitempty"` + + // Role description + RoleDescription string `json:"RoleDescription,omitempty"` + + // The Role ID + RoleID string `json:"RoleID,omitempty"` + + // Role Name + RoleName string `json:"RoleName,omitempty"` + + // Telnexus Account Number + TelnexusAccount string `json:"TelnexusAccount,omitempty"` + + // User Email Address + UserEmail string `json:"UserEmail,omitempty"` + + // User Full Name + UserFullName string `json:"UserFullName,omitempty"` + + // The User ID + UserID string `json:"UserID,omitempty"` + + // Username + Username string `json:"Username,omitempty"` +} + +// Validate validates this user role +func (m *UserRole) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this user role based on context it is used +func (m *UserRole) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UserRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UserRole) UnmarshalBinary(b []byte) error { + var res UserRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/cloud/cloud_client/cloud_client.go b/api/cloud/cloud_client/cloud_client.go new file mode 100644 index 0000000..242ab4e --- /dev/null +++ b/api/cloud/cloud_client/cloud_client.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cloud_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" + + "code.tnxs.net/telnexus/lib/api/cloud/cloud_client/cors" + "code.tnxs.net/telnexus/lib/api/cloud/cloud_client/hub" + "code.tnxs.net/telnexus/lib/api/cloud/cloud_client/user" +) + +// Default cloud HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "cloud.infra.tnxs.net:8080" + // 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 +var DefaultSchemes = []string{"http"} + +// NewHTTPClient creates a new cloud HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Cloud { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new cloud HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Cloud { + // ensure nullable parameters have default + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new cloud client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Cloud { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Cloud) + cli.Transport = transport + cli.Cors = cors.New(transport, formats) + cli.Hub = hub.New(transport, formats) + cli.User = user.New(transport, formats) + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// Cloud is a client for cloud +type Cloud struct { + Cors cors.ClientService + + Hub hub.ClientService + + User user.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Cloud) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.Cors.SetTransport(transport) + c.Hub.SetTransport(transport) + c.User.SetTransport(transport) +} diff --git a/api/cloud/cloud_client/cors/account_options_parameters.go b/api/cloud/cloud_client/cors/account_options_parameters.go new file mode 100644 index 0000000..435c1b6 --- /dev/null +++ b/api/cloud/cloud_client/cors/account_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewAccountOptionsParams creates a new AccountOptionsParams 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 NewAccountOptionsParams() *AccountOptionsParams { + return &AccountOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewAccountOptionsParamsWithTimeout creates a new AccountOptionsParams object +// with the ability to set a timeout on a request. +func NewAccountOptionsParamsWithTimeout(timeout time.Duration) *AccountOptionsParams { + return &AccountOptionsParams{ + timeout: timeout, + } +} + +// NewAccountOptionsParamsWithContext creates a new AccountOptionsParams object +// with the ability to set a context for a request. +func NewAccountOptionsParamsWithContext(ctx context.Context) *AccountOptionsParams { + return &AccountOptionsParams{ + Context: ctx, + } +} + +// NewAccountOptionsParamsWithHTTPClient creates a new AccountOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewAccountOptionsParamsWithHTTPClient(client *http.Client) *AccountOptionsParams { + return &AccountOptionsParams{ + HTTPClient: client, + } +} + +/* AccountOptionsParams contains all the parameters to send to the API endpoint + for the account options operation. + + Typically these are written to a http.Request. +*/ +type AccountOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the account options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AccountOptionsParams) WithDefaults() *AccountOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the account options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AccountOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the account options params +func (o *AccountOptionsParams) WithTimeout(timeout time.Duration) *AccountOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the account options params +func (o *AccountOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the account options params +func (o *AccountOptionsParams) WithContext(ctx context.Context) *AccountOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the account options params +func (o *AccountOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the account options params +func (o *AccountOptionsParams) WithHTTPClient(client *http.Client) *AccountOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the account options params +func (o *AccountOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *AccountOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/cloud/cloud_client/cors/account_options_responses.go b/api/cloud/cloud_client/cors/account_options_responses.go new file mode 100644 index 0000000..6ee4203 --- /dev/null +++ b/api/cloud/cloud_client/cors/account_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// AccountOptionsReader is a Reader for the AccountOptions structure. +type AccountOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AccountOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewAccountOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewAccountOptionsOK creates a AccountOptionsOK with default headers values +func NewAccountOptionsOK() *AccountOptionsOK { + return &AccountOptionsOK{} +} + +/* AccountOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type AccountOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *AccountOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /hubs][%d] accountOptionsOK ", 200) +} + +func (o *AccountOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/cloud/cloud_client/cors/cors_client.go b/api/cloud/cloud_client/cors/cors_client.go new file mode 100644 index 0000000..66151a0 --- /dev/null +++ b/api/cloud/cloud_client/cors/cors_client.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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 cors API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for cors 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 { + AccountOptions(params *AccountOptionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AccountOptionsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + AccountOptions CORS support +*/ +func (a *Client) AccountOptions(params *AccountOptionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AccountOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAccountOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "accountOptions", + Method: "OPTIONS", + PathPattern: "/hubs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &AccountOptionsReader{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.(*AccountOptionsOK) + 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 accountOptions: 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 +} diff --git a/api/cloud/cloud_client/hub/delete_hub_parameters.go b/api/cloud/cloud_client/hub/delete_hub_parameters.go new file mode 100644 index 0000000..1ac706a --- /dev/null +++ b/api/cloud/cloud_client/hub/delete_hub_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package hub + +// 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" +) + +// NewDeleteHubParams creates a new DeleteHubParams 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 NewDeleteHubParams() *DeleteHubParams { + return &DeleteHubParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteHubParamsWithTimeout creates a new DeleteHubParams object +// with the ability to set a timeout on a request. +func NewDeleteHubParamsWithTimeout(timeout time.Duration) *DeleteHubParams { + return &DeleteHubParams{ + timeout: timeout, + } +} + +// NewDeleteHubParamsWithContext creates a new DeleteHubParams object +// with the ability to set a context for a request. +func NewDeleteHubParamsWithContext(ctx context.Context) *DeleteHubParams { + return &DeleteHubParams{ + Context: ctx, + } +} + +// NewDeleteHubParamsWithHTTPClient creates a new DeleteHubParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteHubParamsWithHTTPClient(client *http.Client) *DeleteHubParams { + return &DeleteHubParams{ + HTTPClient: client, + } +} + +/* DeleteHubParams contains all the parameters to send to the API endpoint + for the delete hub operation. + + Typically these are written to a http.Request. +*/ +type DeleteHubParams struct { + + /* AccountID. + + Taxnexus Record Id of an Account + */ + AccountID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete hub params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteHubParams) WithDefaults() *DeleteHubParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete hub params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteHubParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete hub params +func (o *DeleteHubParams) WithTimeout(timeout time.Duration) *DeleteHubParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete hub params +func (o *DeleteHubParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete hub params +func (o *DeleteHubParams) WithContext(ctx context.Context) *DeleteHubParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete hub params +func (o *DeleteHubParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete hub params +func (o *DeleteHubParams) WithHTTPClient(client *http.Client) *DeleteHubParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete hub params +func (o *DeleteHubParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the delete hub params +func (o *DeleteHubParams) WithAccountID(accountID *string) *DeleteHubParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the delete hub params +func (o *DeleteHubParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteHubParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AccountID != nil { + + // query param accountId + var qrAccountID string + + if o.AccountID != nil { + qrAccountID = *o.AccountID + } + qAccountID := qrAccountID + if qAccountID != "" { + + if err := r.SetQueryParam("accountId", qAccountID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/cloud/cloud_client/hub/delete_hub_responses.go b/api/cloud/cloud_client/hub/delete_hub_responses.go new file mode 100644 index 0000000..1728afd --- /dev/null +++ b/api/cloud/cloud_client/hub/delete_hub_responses.go @@ -0,0 +1,270 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package hub + +// 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/telnexus/lib/api/cloud/cloud_models" +) + +// DeleteHubReader is a Reader for the DeleteHub structure. +type DeleteHubReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteHubReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteHubOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeleteHubUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteHubForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteHubNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewDeleteHubUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteHubInternalServerError() + 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()) + } +} + +// NewDeleteHubOK creates a DeleteHubOK with default headers values +func NewDeleteHubOK() *DeleteHubOK { + return &DeleteHubOK{} +} + +/* DeleteHubOK describes a response with status code 200, with default header values. + +Taxnexus Response with Message Objects with Delete Status +*/ +type DeleteHubOK struct { + AccessControlAllowOrigin string + + Payload *cloud_models.DeleteResponse +} + +func (o *DeleteHubOK) Error() string { + return fmt.Sprintf("[DELETE /hubs][%d] deleteHubOK %+v", 200, o.Payload) +} +func (o *DeleteHubOK) GetPayload() *cloud_models.DeleteResponse { + return o.Payload +} + +func (o *DeleteHubOK) 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(cloud_models.DeleteResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteHubUnauthorized creates a DeleteHubUnauthorized with default headers values +func NewDeleteHubUnauthorized() *DeleteHubUnauthorized { + return &DeleteHubUnauthorized{} +} + +/* DeleteHubUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type DeleteHubUnauthorized struct { + Payload *cloud_models.Error +} + +func (o *DeleteHubUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /hubs][%d] deleteHubUnauthorized %+v", 401, o.Payload) +} +func (o *DeleteHubUnauthorized) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *DeleteHubUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteHubForbidden creates a DeleteHubForbidden with default headers values +func NewDeleteHubForbidden() *DeleteHubForbidden { + return &DeleteHubForbidden{} +} + +/* DeleteHubForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type DeleteHubForbidden struct { + Payload *cloud_models.Error +} + +func (o *DeleteHubForbidden) Error() string { + return fmt.Sprintf("[DELETE /hubs][%d] deleteHubForbidden %+v", 403, o.Payload) +} +func (o *DeleteHubForbidden) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *DeleteHubForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteHubNotFound creates a DeleteHubNotFound with default headers values +func NewDeleteHubNotFound() *DeleteHubNotFound { + return &DeleteHubNotFound{} +} + +/* DeleteHubNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type DeleteHubNotFound struct { + Payload *cloud_models.Error +} + +func (o *DeleteHubNotFound) Error() string { + return fmt.Sprintf("[DELETE /hubs][%d] deleteHubNotFound %+v", 404, o.Payload) +} +func (o *DeleteHubNotFound) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *DeleteHubNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteHubUnprocessableEntity creates a DeleteHubUnprocessableEntity with default headers values +func NewDeleteHubUnprocessableEntity() *DeleteHubUnprocessableEntity { + return &DeleteHubUnprocessableEntity{} +} + +/* DeleteHubUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type DeleteHubUnprocessableEntity struct { + Payload *cloud_models.Error +} + +func (o *DeleteHubUnprocessableEntity) Error() string { + return fmt.Sprintf("[DELETE /hubs][%d] deleteHubUnprocessableEntity %+v", 422, o.Payload) +} +func (o *DeleteHubUnprocessableEntity) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *DeleteHubUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteHubInternalServerError creates a DeleteHubInternalServerError with default headers values +func NewDeleteHubInternalServerError() *DeleteHubInternalServerError { + return &DeleteHubInternalServerError{} +} + +/* DeleteHubInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type DeleteHubInternalServerError struct { + Payload *cloud_models.Error +} + +func (o *DeleteHubInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /hubs][%d] deleteHubInternalServerError %+v", 500, o.Payload) +} +func (o *DeleteHubInternalServerError) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *DeleteHubInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/cloud/cloud_client/hub/get_hubs_parameters.go b/api/cloud/cloud_client/hub/get_hubs_parameters.go new file mode 100644 index 0000000..ecaf548 --- /dev/null +++ b/api/cloud/cloud_client/hub/get_hubs_parameters.go @@ -0,0 +1,340 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package hub + +// 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" +) + +// NewGetHubsParams creates a new GetHubsParams 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 NewGetHubsParams() *GetHubsParams { + return &GetHubsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetHubsParamsWithTimeout creates a new GetHubsParams object +// with the ability to set a timeout on a request. +func NewGetHubsParamsWithTimeout(timeout time.Duration) *GetHubsParams { + return &GetHubsParams{ + timeout: timeout, + } +} + +// NewGetHubsParamsWithContext creates a new GetHubsParams object +// with the ability to set a context for a request. +func NewGetHubsParamsWithContext(ctx context.Context) *GetHubsParams { + return &GetHubsParams{ + Context: ctx, + } +} + +// NewGetHubsParamsWithHTTPClient creates a new GetHubsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetHubsParamsWithHTTPClient(client *http.Client) *GetHubsParams { + return &GetHubsParams{ + HTTPClient: client, + } +} + +/* GetHubsParams contains all the parameters to send to the API endpoint + for the get hubs operation. + + Typically these are written to a http.Request. +*/ +type GetHubsParams struct { + + /* AccountID. + + Taxnexus Record Id of an Account + */ + AccountID *string + + /* Active. + + Retrieve active records? + */ + Active *bool + + /* Email. + + Email address? + */ + Email *string + + /* Limit. + + How many objects to return at one time + + Format: int64 + */ + Limit *int64 + + /* Name. + + The Name of this Object + */ + Name *string + + /* Offset. + + How many objects to skip? (default 0) + + Format: int64 + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get hubs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetHubsParams) WithDefaults() *GetHubsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get hubs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetHubsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get hubs params +func (o *GetHubsParams) WithTimeout(timeout time.Duration) *GetHubsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get hubs params +func (o *GetHubsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get hubs params +func (o *GetHubsParams) WithContext(ctx context.Context) *GetHubsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get hubs params +func (o *GetHubsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get hubs params +func (o *GetHubsParams) WithHTTPClient(client *http.Client) *GetHubsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get hubs params +func (o *GetHubsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get hubs params +func (o *GetHubsParams) WithAccountID(accountID *string) *GetHubsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get hubs params +func (o *GetHubsParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithActive adds the active to the get hubs params +func (o *GetHubsParams) WithActive(active *bool) *GetHubsParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get hubs params +func (o *GetHubsParams) SetActive(active *bool) { + o.Active = active +} + +// WithEmail adds the email to the get hubs params +func (o *GetHubsParams) WithEmail(email *string) *GetHubsParams { + o.SetEmail(email) + return o +} + +// SetEmail adds the email to the get hubs params +func (o *GetHubsParams) SetEmail(email *string) { + o.Email = email +} + +// WithLimit adds the limit to the get hubs params +func (o *GetHubsParams) WithLimit(limit *int64) *GetHubsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get hubs params +func (o *GetHubsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the get hubs params +func (o *GetHubsParams) WithName(name *string) *GetHubsParams { + o.SetName(name) + return o +} + +// SetName adds the name to the get hubs params +func (o *GetHubsParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the get hubs params +func (o *GetHubsParams) WithOffset(offset *int64) *GetHubsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get hubs params +func (o *GetHubsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetHubsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AccountID != nil { + + // query param accountId + var qrAccountID string + + if o.AccountID != nil { + qrAccountID = *o.AccountID + } + qAccountID := qrAccountID + if qAccountID != "" { + + if err := r.SetQueryParam("accountId", qAccountID); err != nil { + return err + } + } + } + + if o.Active != nil { + + // query param active + var qrActive bool + + if o.Active != nil { + qrActive = *o.Active + } + qActive := swag.FormatBool(qrActive) + if qActive != "" { + + if err := r.SetQueryParam("active", qActive); err != nil { + return err + } + } + } + + if o.Email != nil { + + // query param email + var qrEmail string + + if o.Email != nil { + qrEmail = *o.Email + } + qEmail := qrEmail + if qEmail != "" { + + if err := r.SetQueryParam("email", qEmail); 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.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); 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 +} diff --git a/api/cloud/cloud_client/hub/get_hubs_responses.go b/api/cloud/cloud_client/hub/get_hubs_responses.go new file mode 100644 index 0000000..6fb7d32 --- /dev/null +++ b/api/cloud/cloud_client/hub/get_hubs_responses.go @@ -0,0 +1,278 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package hub + +// 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/telnexus/lib/api/cloud/cloud_models" +) + +// GetHubsReader is a Reader for the GetHubs structure. +type GetHubsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetHubsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetHubsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetHubsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetHubsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetHubsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetHubsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetHubsInternalServerError() + 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()) + } +} + +// NewGetHubsOK creates a GetHubsOK with default headers values +func NewGetHubsOK() *GetHubsOK { + return &GetHubsOK{} +} + +/* GetHubsOK describes a response with status code 200, with default header values. + +Telnexus Response with Hub objects +*/ +type GetHubsOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *cloud_models.HubResponse +} + +func (o *GetHubsOK) Error() string { + return fmt.Sprintf("[GET /hubs][%d] getHubsOK %+v", 200, o.Payload) +} +func (o *GetHubsOK) GetPayload() *cloud_models.HubResponse { + return o.Payload +} + +func (o *GetHubsOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(cloud_models.HubResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetHubsUnauthorized creates a GetHubsUnauthorized with default headers values +func NewGetHubsUnauthorized() *GetHubsUnauthorized { + return &GetHubsUnauthorized{} +} + +/* GetHubsUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetHubsUnauthorized struct { + Payload *cloud_models.Error +} + +func (o *GetHubsUnauthorized) Error() string { + return fmt.Sprintf("[GET /hubs][%d] getHubsUnauthorized %+v", 401, o.Payload) +} +func (o *GetHubsUnauthorized) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *GetHubsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetHubsForbidden creates a GetHubsForbidden with default headers values +func NewGetHubsForbidden() *GetHubsForbidden { + return &GetHubsForbidden{} +} + +/* GetHubsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetHubsForbidden struct { + Payload *cloud_models.Error +} + +func (o *GetHubsForbidden) Error() string { + return fmt.Sprintf("[GET /hubs][%d] getHubsForbidden %+v", 403, o.Payload) +} +func (o *GetHubsForbidden) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *GetHubsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetHubsNotFound creates a GetHubsNotFound with default headers values +func NewGetHubsNotFound() *GetHubsNotFound { + return &GetHubsNotFound{} +} + +/* GetHubsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetHubsNotFound struct { + Payload *cloud_models.Error +} + +func (o *GetHubsNotFound) Error() string { + return fmt.Sprintf("[GET /hubs][%d] getHubsNotFound %+v", 404, o.Payload) +} +func (o *GetHubsNotFound) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *GetHubsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetHubsUnprocessableEntity creates a GetHubsUnprocessableEntity with default headers values +func NewGetHubsUnprocessableEntity() *GetHubsUnprocessableEntity { + return &GetHubsUnprocessableEntity{} +} + +/* GetHubsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetHubsUnprocessableEntity struct { + Payload *cloud_models.Error +} + +func (o *GetHubsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /hubs][%d] getHubsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetHubsUnprocessableEntity) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *GetHubsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetHubsInternalServerError creates a GetHubsInternalServerError with default headers values +func NewGetHubsInternalServerError() *GetHubsInternalServerError { + return &GetHubsInternalServerError{} +} + +/* GetHubsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetHubsInternalServerError struct { + Payload *cloud_models.Error +} + +func (o *GetHubsInternalServerError) Error() string { + return fmt.Sprintf("[GET /hubs][%d] getHubsInternalServerError %+v", 500, o.Payload) +} +func (o *GetHubsInternalServerError) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *GetHubsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/cloud/cloud_client/hub/hub_client.go b/api/cloud/cloud_client/hub/hub_client.go new file mode 100644 index 0000000..0d1a617 --- /dev/null +++ b/api/cloud/cloud_client/hub/hub_client.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package hub + +// 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 hub API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for hub 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 { + DeleteHub(params *DeleteHubParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteHubOK, error) + + GetHubs(params *GetHubsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetHubsOK, error) + + PostHubs(params *PostHubsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostHubsOK, error) + + PutHub(params *PutHubParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutHubOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteHub deletes an hub + + Delete Telnexus Hub record +*/ +func (a *Client) DeleteHub(params *DeleteHubParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteHubOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteHubParams() + } + op := &runtime.ClientOperation{ + ID: "deleteHub", + Method: "DELETE", + PathPattern: "/hubs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteHubReader{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.(*DeleteHubOK) + 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 deleteHub: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetHubs gets a list of accounts + + Return a list of all available Hubs +*/ +func (a *Client) GetHubs(params *GetHubsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetHubsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetHubsParams() + } + op := &runtime.ClientOperation{ + ID: "getHubs", + Method: "GET", + PathPattern: "/hubs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetHubsReader{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.(*GetHubsOK) + 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 getHubs: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostHubs adds a new account to telnexus + + Hub record to be added +*/ +func (a *Client) PostHubs(params *PostHubsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostHubsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostHubsParams() + } + op := &runtime.ClientOperation{ + ID: "postHubs", + Method: "POST", + PathPattern: "/hubs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostHubsReader{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.(*PostHubsOK) + 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 postHubs: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutHub updates a single account + + Update Hubs +*/ +func (a *Client) PutHub(params *PutHubParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutHubOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutHubParams() + } + op := &runtime.ClientOperation{ + ID: "putHub", + Method: "PUT", + PathPattern: "/hubs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutHubReader{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.(*PutHubOK) + 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 putHub: 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 +} diff --git a/api/cloud/cloud_client/hub/post_hubs_parameters.go b/api/cloud/cloud_client/hub/post_hubs_parameters.go new file mode 100644 index 0000000..004010a --- /dev/null +++ b/api/cloud/cloud_client/hub/post_hubs_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package hub + +// 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/telnexus/lib/api/cloud/cloud_models" +) + +// NewPostHubsParams creates a new PostHubsParams 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 NewPostHubsParams() *PostHubsParams { + return &PostHubsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostHubsParamsWithTimeout creates a new PostHubsParams object +// with the ability to set a timeout on a request. +func NewPostHubsParamsWithTimeout(timeout time.Duration) *PostHubsParams { + return &PostHubsParams{ + timeout: timeout, + } +} + +// NewPostHubsParamsWithContext creates a new PostHubsParams object +// with the ability to set a context for a request. +func NewPostHubsParamsWithContext(ctx context.Context) *PostHubsParams { + return &PostHubsParams{ + Context: ctx, + } +} + +// NewPostHubsParamsWithHTTPClient creates a new PostHubsParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostHubsParamsWithHTTPClient(client *http.Client) *PostHubsParams { + return &PostHubsParams{ + HTTPClient: client, + } +} + +/* PostHubsParams contains all the parameters to send to the API endpoint + for the post hubs operation. + + Typically these are written to a http.Request. +*/ +type PostHubsParams struct { + + /* HubRequest. + + An array of new Hub records + */ + HubRequest *cloud_models.HubRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post hubs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostHubsParams) WithDefaults() *PostHubsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post hubs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostHubsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post hubs params +func (o *PostHubsParams) WithTimeout(timeout time.Duration) *PostHubsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post hubs params +func (o *PostHubsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post hubs params +func (o *PostHubsParams) WithContext(ctx context.Context) *PostHubsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post hubs params +func (o *PostHubsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post hubs params +func (o *PostHubsParams) WithHTTPClient(client *http.Client) *PostHubsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post hubs params +func (o *PostHubsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithHubRequest adds the hubRequest to the post hubs params +func (o *PostHubsParams) WithHubRequest(hubRequest *cloud_models.HubRequest) *PostHubsParams { + o.SetHubRequest(hubRequest) + return o +} + +// SetHubRequest adds the hubRequest to the post hubs params +func (o *PostHubsParams) SetHubRequest(hubRequest *cloud_models.HubRequest) { + o.HubRequest = hubRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostHubsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.HubRequest != nil { + if err := r.SetBodyParam(o.HubRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/cloud/cloud_client/hub/post_hubs_responses.go b/api/cloud/cloud_client/hub/post_hubs_responses.go new file mode 100644 index 0000000..99415a7 --- /dev/null +++ b/api/cloud/cloud_client/hub/post_hubs_responses.go @@ -0,0 +1,278 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package hub + +// 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/telnexus/lib/api/cloud/cloud_models" +) + +// PostHubsReader is a Reader for the PostHubs structure. +type PostHubsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostHubsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostHubsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostHubsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostHubsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostHubsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostHubsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostHubsInternalServerError() + 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()) + } +} + +// NewPostHubsOK creates a PostHubsOK with default headers values +func NewPostHubsOK() *PostHubsOK { + return &PostHubsOK{} +} + +/* PostHubsOK describes a response with status code 200, with default header values. + +Telnexus Response with Hub objects +*/ +type PostHubsOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *cloud_models.HubResponse +} + +func (o *PostHubsOK) Error() string { + return fmt.Sprintf("[POST /hubs][%d] postHubsOK %+v", 200, o.Payload) +} +func (o *PostHubsOK) GetPayload() *cloud_models.HubResponse { + return o.Payload +} + +func (o *PostHubsOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(cloud_models.HubResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostHubsUnauthorized creates a PostHubsUnauthorized with default headers values +func NewPostHubsUnauthorized() *PostHubsUnauthorized { + return &PostHubsUnauthorized{} +} + +/* PostHubsUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostHubsUnauthorized struct { + Payload *cloud_models.Error +} + +func (o *PostHubsUnauthorized) Error() string { + return fmt.Sprintf("[POST /hubs][%d] postHubsUnauthorized %+v", 401, o.Payload) +} +func (o *PostHubsUnauthorized) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *PostHubsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostHubsForbidden creates a PostHubsForbidden with default headers values +func NewPostHubsForbidden() *PostHubsForbidden { + return &PostHubsForbidden{} +} + +/* PostHubsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostHubsForbidden struct { + Payload *cloud_models.Error +} + +func (o *PostHubsForbidden) Error() string { + return fmt.Sprintf("[POST /hubs][%d] postHubsForbidden %+v", 403, o.Payload) +} +func (o *PostHubsForbidden) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *PostHubsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostHubsNotFound creates a PostHubsNotFound with default headers values +func NewPostHubsNotFound() *PostHubsNotFound { + return &PostHubsNotFound{} +} + +/* PostHubsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostHubsNotFound struct { + Payload *cloud_models.Error +} + +func (o *PostHubsNotFound) Error() string { + return fmt.Sprintf("[POST /hubs][%d] postHubsNotFound %+v", 404, o.Payload) +} +func (o *PostHubsNotFound) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *PostHubsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostHubsUnprocessableEntity creates a PostHubsUnprocessableEntity with default headers values +func NewPostHubsUnprocessableEntity() *PostHubsUnprocessableEntity { + return &PostHubsUnprocessableEntity{} +} + +/* PostHubsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostHubsUnprocessableEntity struct { + Payload *cloud_models.Error +} + +func (o *PostHubsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /hubs][%d] postHubsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PostHubsUnprocessableEntity) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *PostHubsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostHubsInternalServerError creates a PostHubsInternalServerError with default headers values +func NewPostHubsInternalServerError() *PostHubsInternalServerError { + return &PostHubsInternalServerError{} +} + +/* PostHubsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostHubsInternalServerError struct { + Payload *cloud_models.Error +} + +func (o *PostHubsInternalServerError) Error() string { + return fmt.Sprintf("[POST /hubs][%d] postHubsInternalServerError %+v", 500, o.Payload) +} +func (o *PostHubsInternalServerError) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *PostHubsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/cloud/cloud_client/hub/put_hub_parameters.go b/api/cloud/cloud_client/hub/put_hub_parameters.go new file mode 100644 index 0000000..d2163e9 --- /dev/null +++ b/api/cloud/cloud_client/hub/put_hub_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package hub + +// 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/telnexus/lib/api/cloud/cloud_models" +) + +// NewPutHubParams creates a new PutHubParams 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 NewPutHubParams() *PutHubParams { + return &PutHubParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPutHubParamsWithTimeout creates a new PutHubParams object +// with the ability to set a timeout on a request. +func NewPutHubParamsWithTimeout(timeout time.Duration) *PutHubParams { + return &PutHubParams{ + timeout: timeout, + } +} + +// NewPutHubParamsWithContext creates a new PutHubParams object +// with the ability to set a context for a request. +func NewPutHubParamsWithContext(ctx context.Context) *PutHubParams { + return &PutHubParams{ + Context: ctx, + } +} + +// NewPutHubParamsWithHTTPClient creates a new PutHubParams object +// with the ability to set a custom HTTPClient for a request. +func NewPutHubParamsWithHTTPClient(client *http.Client) *PutHubParams { + return &PutHubParams{ + HTTPClient: client, + } +} + +/* PutHubParams contains all the parameters to send to the API endpoint + for the put hub operation. + + Typically these are written to a http.Request. +*/ +type PutHubParams struct { + + /* HubRequest. + + An array of new Hub records + */ + HubRequest *cloud_models.HubRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put hub params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutHubParams) WithDefaults() *PutHubParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put hub params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutHubParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the put hub params +func (o *PutHubParams) WithTimeout(timeout time.Duration) *PutHubParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put hub params +func (o *PutHubParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put hub params +func (o *PutHubParams) WithContext(ctx context.Context) *PutHubParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put hub params +func (o *PutHubParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put hub params +func (o *PutHubParams) WithHTTPClient(client *http.Client) *PutHubParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put hub params +func (o *PutHubParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithHubRequest adds the hubRequest to the put hub params +func (o *PutHubParams) WithHubRequest(hubRequest *cloud_models.HubRequest) *PutHubParams { + o.SetHubRequest(hubRequest) + return o +} + +// SetHubRequest adds the hubRequest to the put hub params +func (o *PutHubParams) SetHubRequest(hubRequest *cloud_models.HubRequest) { + o.HubRequest = hubRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutHubParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.HubRequest != nil { + if err := r.SetBodyParam(o.HubRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/cloud/cloud_client/hub/put_hub_responses.go b/api/cloud/cloud_client/hub/put_hub_responses.go new file mode 100644 index 0000000..0240c97 --- /dev/null +++ b/api/cloud/cloud_client/hub/put_hub_responses.go @@ -0,0 +1,278 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package hub + +// 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/telnexus/lib/api/cloud/cloud_models" +) + +// PutHubReader is a Reader for the PutHub structure. +type PutHubReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutHubReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutHubOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutHubUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutHubForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutHubNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutHubUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutHubInternalServerError() + 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()) + } +} + +// NewPutHubOK creates a PutHubOK with default headers values +func NewPutHubOK() *PutHubOK { + return &PutHubOK{} +} + +/* PutHubOK describes a response with status code 200, with default header values. + +Telnexus Response with Hub objects +*/ +type PutHubOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *cloud_models.HubResponse +} + +func (o *PutHubOK) Error() string { + return fmt.Sprintf("[PUT /hubs][%d] putHubOK %+v", 200, o.Payload) +} +func (o *PutHubOK) GetPayload() *cloud_models.HubResponse { + return o.Payload +} + +func (o *PutHubOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(cloud_models.HubResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutHubUnauthorized creates a PutHubUnauthorized with default headers values +func NewPutHubUnauthorized() *PutHubUnauthorized { + return &PutHubUnauthorized{} +} + +/* PutHubUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutHubUnauthorized struct { + Payload *cloud_models.Error +} + +func (o *PutHubUnauthorized) Error() string { + return fmt.Sprintf("[PUT /hubs][%d] putHubUnauthorized %+v", 401, o.Payload) +} +func (o *PutHubUnauthorized) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *PutHubUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutHubForbidden creates a PutHubForbidden with default headers values +func NewPutHubForbidden() *PutHubForbidden { + return &PutHubForbidden{} +} + +/* PutHubForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PutHubForbidden struct { + Payload *cloud_models.Error +} + +func (o *PutHubForbidden) Error() string { + return fmt.Sprintf("[PUT /hubs][%d] putHubForbidden %+v", 403, o.Payload) +} +func (o *PutHubForbidden) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *PutHubForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutHubNotFound creates a PutHubNotFound with default headers values +func NewPutHubNotFound() *PutHubNotFound { + return &PutHubNotFound{} +} + +/* PutHubNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PutHubNotFound struct { + Payload *cloud_models.Error +} + +func (o *PutHubNotFound) Error() string { + return fmt.Sprintf("[PUT /hubs][%d] putHubNotFound %+v", 404, o.Payload) +} +func (o *PutHubNotFound) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *PutHubNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutHubUnprocessableEntity creates a PutHubUnprocessableEntity with default headers values +func NewPutHubUnprocessableEntity() *PutHubUnprocessableEntity { + return &PutHubUnprocessableEntity{} +} + +/* PutHubUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutHubUnprocessableEntity struct { + Payload *cloud_models.Error +} + +func (o *PutHubUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /hubs][%d] putHubUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PutHubUnprocessableEntity) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *PutHubUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutHubInternalServerError creates a PutHubInternalServerError with default headers values +func NewPutHubInternalServerError() *PutHubInternalServerError { + return &PutHubInternalServerError{} +} + +/* PutHubInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PutHubInternalServerError struct { + Payload *cloud_models.Error +} + +func (o *PutHubInternalServerError) Error() string { + return fmt.Sprintf("[PUT /hubs][%d] putHubInternalServerError %+v", 500, o.Payload) +} +func (o *PutHubInternalServerError) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *PutHubInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/cloud/cloud_client/user/get_users_parameters.go b/api/cloud/cloud_client/user/get_users_parameters.go new file mode 100644 index 0000000..b24a54c --- /dev/null +++ b/api/cloud/cloud_client/user/get_users_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetUsersParams creates a new GetUsersParams 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 NewGetUsersParams() *GetUsersParams { + return &GetUsersParams{ + timeout: 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, + } +} + +// NewGetUsersParamsWithContext creates a new GetUsersParams object +// with the ability to set a context for a request. +func NewGetUsersParamsWithContext(ctx context.Context) *GetUsersParams { + return &GetUsersParams{ + Context: ctx, + } +} + +// NewGetUsersParamsWithHTTPClient creates a new GetUsersParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetUsersParamsWithHTTPClient(client *http.Client) *GetUsersParams { + return &GetUsersParams{ + HTTPClient: client, + } +} + +/* GetUsersParams contains all the parameters to send to the API endpoint + for the get users operation. + + Typically these are written to a http.Request. +*/ +type GetUsersParams struct { + + /* Apikey. + + Service account or developer API key + */ + Apikey *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetUsersParams) WithDefaults() *GetUsersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetUsersParams) SetDefaults() { + // no default values defined for this parameter +} + +// 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 +func (o *GetUsersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get users params +func (o *GetUsersParams) WithContext(ctx context.Context) *GetUsersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get users params +func (o *GetUsersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// 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 +func (o *GetUsersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// 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 +func (o *GetUsersParams) SetApikey(apikey *string) { + o.Apikey = apikey +} + +// WriteToRequest writes these params to a swagger request +func (o *GetUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Apikey != nil { + + // query param apikey + var qrApikey string + + if o.Apikey != nil { + qrApikey = *o.Apikey + } + qApikey := qrApikey + if qApikey != "" { + + if err := r.SetQueryParam("apikey", qApikey); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/cloud/cloud_client/user/get_users_responses.go b/api/cloud/cloud_client/user/get_users_responses.go new file mode 100644 index 0000000..cc917e9 --- /dev/null +++ b/api/cloud/cloud_client/user/get_users_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/cloud/cloud_models" +) + +// GetUsersReader is a Reader for the GetUsers structure. +type GetUsersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetUsersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetUsersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetUsersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetUsersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetUsersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetUsersInternalServerError() + 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()) + } +} + +// NewGetUsersOK creates a GetUsersOK with default headers values +func NewGetUsersOK() *GetUsersOK { + return &GetUsersOK{} +} + +/* GetUsersOK describes a response with status code 200, with default header values. + +Taxnexus Response with User objects +*/ +type GetUsersOK struct { + Payload *cloud_models.UserResponse +} + +func (o *GetUsersOK) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersOK %+v", 200, o.Payload) +} +func (o *GetUsersOK) GetPayload() *cloud_models.UserResponse { + return o.Payload +} + +func (o *GetUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.UserResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUsersUnauthorized creates a GetUsersUnauthorized with default headers values +func NewGetUsersUnauthorized() *GetUsersUnauthorized { + return &GetUsersUnauthorized{} +} + +/* GetUsersUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetUsersUnauthorized struct { + Payload *cloud_models.Error +} + +func (o *GetUsersUnauthorized) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersUnauthorized %+v", 401, o.Payload) +} +func (o *GetUsersUnauthorized) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *GetUsersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUsersForbidden creates a GetUsersForbidden with default headers values +func NewGetUsersForbidden() *GetUsersForbidden { + return &GetUsersForbidden{} +} + +/* GetUsersForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetUsersForbidden struct { + Payload *cloud_models.Error +} + +func (o *GetUsersForbidden) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersForbidden %+v", 403, o.Payload) +} +func (o *GetUsersForbidden) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *GetUsersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUsersNotFound creates a GetUsersNotFound with default headers values +func NewGetUsersNotFound() *GetUsersNotFound { + return &GetUsersNotFound{} +} + +/* GetUsersNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetUsersNotFound struct { + Payload *cloud_models.Error +} + +func (o *GetUsersNotFound) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersNotFound %+v", 404, o.Payload) +} +func (o *GetUsersNotFound) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *GetUsersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUsersUnprocessableEntity creates a GetUsersUnprocessableEntity with default headers values +func NewGetUsersUnprocessableEntity() *GetUsersUnprocessableEntity { + return &GetUsersUnprocessableEntity{} +} + +/* GetUsersUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetUsersUnprocessableEntity struct { + Payload *cloud_models.Error +} + +func (o *GetUsersUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetUsersUnprocessableEntity) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *GetUsersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUsersInternalServerError creates a GetUsersInternalServerError with default headers values +func NewGetUsersInternalServerError() *GetUsersInternalServerError { + return &GetUsersInternalServerError{} +} + +/* GetUsersInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetUsersInternalServerError struct { + Payload *cloud_models.Error +} + +func (o *GetUsersInternalServerError) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersInternalServerError %+v", 500, o.Payload) +} +func (o *GetUsersInternalServerError) GetPayload() *cloud_models.Error { + return o.Payload +} + +func (o *GetUsersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(cloud_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/cloud/cloud_client/user/user_client.go b/api/cloud/cloud_client/user/user_client.go new file mode 100644 index 0000000..3d1a6e1 --- /dev/null +++ b/api/cloud/cloud_client/user/user_client.go @@ -0,0 +1,86 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new user API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for user 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 { + GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUsersOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetUsers checks API key + + Checks for a valid API key, and returns full user record +*/ +func (a *Client) GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUsersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetUsersParams() + } + op := &runtime.ClientOperation{ + ID: "getUsers", + Method: "GET", + PathPattern: "/users", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + 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) + if err != nil { + return nil, err + } + 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 + 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) { + a.transport = transport +} diff --git a/api/cloud/cloud_models/address.go b/api/cloud/cloud_models/address.go new file mode 100644 index 0000000..e6ac2c0 --- /dev/null +++ b/api/cloud/cloud_models/address.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cloud_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" +) + +// Address address +// +// swagger:model Address +type Address struct { + + // City + City string `json:"City,omitempty"` + + // Country full name + Country string `json:"Country,omitempty"` + + // Country Code + CountryCode string `json:"CountryCode,omitempty"` + + // Postal Code + PostalCode string `json:"PostalCode,omitempty"` + + // State full name + State string `json:"State,omitempty"` + + // State Code + StateCode string `json:"StateCode,omitempty"` + + // Street number and name + Street string `json:"Street,omitempty"` +} + +// Validate validates this address +func (m *Address) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this address based on context it is used +func (m *Address) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Address) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Address) UnmarshalBinary(b []byte) error { + var res Address + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/cloud/cloud_models/delete_response.go b/api/cloud/cloud_models/delete_response.go new file mode 100644 index 0000000..8e9f149 --- /dev/null +++ b/api/cloud/cloud_models/delete_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cloud_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DeleteResponse delete response +// +// swagger:model DeleteResponse +type DeleteResponse struct { + + // data + Data []*Message `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this delete response +func (m *DeleteResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeleteResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DeleteResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this delete response based on the context it is used +func (m *DeleteResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeleteResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DeleteResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeleteResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeleteResponse) UnmarshalBinary(b []byte) error { + var res DeleteResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/cloud/cloud_models/error.go b/api/cloud/cloud_models/error.go new file mode 100644 index 0000000..a3c1f5d --- /dev/null +++ b/api/cloud/cloud_models/error.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cloud_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" +) + +// Error error +// +// swagger:model Error +type Error struct { + + // code + Code int32 `json:"Code,omitempty"` + + // fields + Fields string `json:"Fields,omitempty"` + + // message + Message string `json:"Message,omitempty"` +} + +// Validate validates this error +func (m *Error) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this error based on context it is used +func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Error) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Error) UnmarshalBinary(b []byte) error { + var res Error + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/cloud/cloud_models/hub.go b/api/cloud/cloud_models/hub.go new file mode 100644 index 0000000..defe9c8 --- /dev/null +++ b/api/cloud/cloud_models/hub.go @@ -0,0 +1,93 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cloud_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" +) + +// Hub hub +// +// swagger:model Hub +type Hub struct { + + // Account + AccountID string `json:"AccountID,omitempty"` + + // Billing Contact + BillingContactID string `json:"BillingContactID,omitempty"` + + // Contact + ContactID string `json:"ContactID,omitempty"` + + // Created By + CreatedByID string `json:"CreatedById,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Current Users + CurrentUsers float64 `json:"CurrentUsers,omitempty"` + + // Record Id + ID string `json:"ID,omitempty"` + + // Last Modified By + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modifed Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Max Users + MaxUsers float64 `json:"MaxUsers,omitempty"` + + // Hub Name + Name string `json:"Name,omitempty"` + + // Order Item + OrderItem string `json:"OrderItem,omitempty"` + + // Vendor + VendorID string `json:"VendorID,omitempty"` + + // Vendor Tenant ID + VendorTenantID string `json:"VendorTenantID,omitempty"` +} + +// Validate validates this hub +func (m *Hub) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this hub based on context it is used +func (m *Hub) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Hub) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Hub) UnmarshalBinary(b []byte) error { + var res Hub + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/cloud/cloud_models/hub_request.go b/api/cloud/cloud_models/hub_request.go new file mode 100644 index 0000000..e8fd135 --- /dev/null +++ b/api/cloud/cloud_models/hub_request.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cloud_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HubRequest An array of Hub objects +// +// swagger:model HubRequest +type HubRequest struct { + + // data + Data []*Hub `json:"Data"` +} + +// Validate validates this hub request +func (m *HubRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HubRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this hub request based on the context it is used +func (m *HubRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HubRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HubRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HubRequest) UnmarshalBinary(b []byte) error { + var res HubRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/cloud/cloud_models/hub_response.go b/api/cloud/cloud_models/hub_response.go new file mode 100644 index 0000000..d348859 --- /dev/null +++ b/api/cloud/cloud_models/hub_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cloud_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HubResponse An array of Hub objects +// +// swagger:model HubResponse +type HubResponse struct { + + // data + Data []*Hub `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this hub response +func (m *HubResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HubResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *HubResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this hub response based on the context it is used +func (m *HubResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HubResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *HubResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HubResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HubResponse) UnmarshalBinary(b []byte) error { + var res HubResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/cloud/cloud_models/message.go b/api/cloud/cloud_models/message.go new file mode 100644 index 0000000..d3abda8 --- /dev/null +++ b/api/cloud/cloud_models/message.go @@ -0,0 +1,57 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cloud_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" +) + +// Message message +// +// swagger:model Message +type Message struct { + + // message + Message string `json:"message,omitempty"` + + // ref + Ref string `json:"ref,omitempty"` +} + +// Validate validates this message +func (m *Message) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this message based on context it is used +func (m *Message) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Message) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Message) UnmarshalBinary(b []byte) error { + var res Message + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/cloud/cloud_models/response_meta.go b/api/cloud/cloud_models/response_meta.go new file mode 100644 index 0000000..a428617 --- /dev/null +++ b/api/cloud/cloud_models/response_meta.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cloud_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" +) + +// ResponseMeta response meta +// +// swagger:model ResponseMeta +type ResponseMeta struct { + + // Microservice Contact Info + Contact string `json:"Contact,omitempty"` + + // Copyright Info + Copyright string `json:"Copyright,omitempty"` + + // License Information and Restrictions + License string `json:"License,omitempty"` + + // Operation ID + OperationID string `json:"OperationID,omitempty"` + + // Request IP Address + RequestIP string `json:"RequestIP,omitempty"` + + // Request Type + RequestType string `json:"RequestType,omitempty"` + + // Request URL + RequestURL string `json:"RequestURL,omitempty"` + + // Data Server Info + ServerInfo string `json:"ServerInfo,omitempty"` + + // Data Server Response Time (ms) + ServerResponseTime string `json:"ServerResponseTime,omitempty"` + + // Backend Server Timestamp + ServerTimestamp string `json:"ServerTimestamp,omitempty"` + + // Taxnexus Account Number used for recording transactions + TelnexusAccount string `json:"TelnexusAccount,omitempty"` +} + +// Validate validates this response meta +func (m *ResponseMeta) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this response meta based on context it is used +func (m *ResponseMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ResponseMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ResponseMeta) UnmarshalBinary(b []byte) error { + var res ResponseMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/cloud/cloud_models/tenant_user.go b/api/cloud/cloud_models/tenant_user.go new file mode 100644 index 0000000..3c387ee --- /dev/null +++ b/api/cloud/cloud_models/tenant_user.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cloud_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" +) + +// TenantUser Relationship object that connects users to a tenant +// +// swagger:model TenantUser +type TenantUser struct { + + // The makeTenantUser access level for this User + AccessLevel string `json:"AccessLevel,omitempty"` + + // Account ID + AccountID string `json:"AccountID,omitempty"` + + // Auth0 User ID + Auth0UserID string `json:"Auth0UserID,omitempty"` + + // Account Name + CompanyName string `json:"CompanyName,omitempty"` + + // Contact ID + ContactID string `json:"ContactID,omitempty"` + + // Taxnexus Account + TelnexusAccount string `json:"TelnexusAccount,omitempty"` + + // Tenant active? + TenantActive bool `json:"TenantActive,omitempty"` + + // The Tenant ID + TenantID string `json:"TenantID,omitempty"` + + // Tenant Name + TenantName string `json:"TenantName,omitempty"` + + // Tenant Status + TenantStatus string `json:"TenantStatus,omitempty"` + + // Tenant type + TenantType string `json:"TenantType,omitempty"` + + // Tenant Version + TenantVersion string `json:"TenantVersion,omitempty"` + + // User Email Address + UserEmail string `json:"UserEmail,omitempty"` + + // User Full Name + UserFullName string `json:"UserFullName,omitempty"` + + // The User ID + UserID string `json:"UserID,omitempty"` + + // Username + Username string `json:"Username,omitempty"` +} + +// Validate validates this tenant user +func (m *TenantUser) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this tenant user based on context it is used +func (m *TenantUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TenantUser) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TenantUser) UnmarshalBinary(b []byte) error { + var res TenantUser + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/cloud/cloud_models/user.go b/api/cloud/cloud_models/user.go new file mode 100644 index 0000000..2a67318 --- /dev/null +++ b/api/cloud/cloud_models/user.go @@ -0,0 +1,376 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cloud_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// User user +// +// swagger:model User +type User struct { + + // API Key + APIKey string `json:"APIKey,omitempty"` + + // About Me + AboutMe string `json:"AboutMe,omitempty"` + + // Account ID + AccountID string `json:"AccountID,omitempty"` + + // address + Address *Address `json:"Address,omitempty"` + + // Alias + Alias string `json:"Alias,omitempty"` + + // Auth0 User Id + Auth0UserID string `json:"Auth0UserID,omitempty"` + + // Nickname + CommunityNickname string `json:"CommunityNickname,omitempty"` + + // Company Name + CompanyName string `json:"CompanyName,omitempty"` + + // Contact + ContactID string `json:"ContactID,omitempty"` + + // Created User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Date Created + CreatedDate string `json:"CreatedDate,omitempty"` + + // Delegated Approver + DelegatedApproverID string `json:"DelegatedApproverID,omitempty"` + + // Department + Department string `json:"Department,omitempty"` + + // Division + Division string `json:"Division,omitempty"` + + // Email address + Email string `json:"Email,omitempty"` + + // Employee Number + EmployeeNumber string `json:"EmployeeNumber,omitempty"` + + // Time day ends + EndOfDay string `json:"EndOfDay,omitempty"` + + // Environment + Environment string `json:"Environment,omitempty"` + + // Extension + Extension string `json:"Extension,omitempty"` + + // Fabric API Key + FabricAPIKey string `json:"FabricAPIKey,omitempty"` + + // Fax + Fax string `json:"Fax,omitempty"` + + // The first name + FirstName string `json:"FirstName,omitempty"` + + // Allow Forecasting + ForecastEnabled bool `json:"ForecastEnabled,omitempty"` + + // Full Photo URL + FullPhotoURL string `json:"FullPhotoURL,omitempty"` + + // Taxnexus ID + ID string `json:"ID,omitempty"` + + // Active + IsActive bool `json:"IsActive,omitempty"` + + // Is the user enabled for Communities? + IsPortalEnabled bool `json:"IsPortalEnabled,omitempty"` + + // Has Profile Photo + IsProphilePhotoActive bool `json:"IsProphilePhotoActive,omitempty"` + + // is system controlled + IsSystemControlled bool `json:"IsSystemControlled,omitempty"` + + // IP address of last login + LastIP string `json:"LastIP,omitempty"` + + // Last login time + LastLogin string `json:"LastLogin,omitempty"` + + // Last Modified User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // The Last Name + LastName string `json:"LastName,omitempty"` + + // Number of times user has logged in + LoginCount int64 `json:"LoginCount,omitempty"` + + // Manager + ManagerID string `json:"ManagerID,omitempty"` + + // Mobile + MobilePhone string `json:"MobilePhone,omitempty"` + + // Name + Name string `json:"Name,omitempty"` + + // Out of office message + OutOfOfficeMessage string `json:"OutOfOfficeMessage,omitempty"` + + // Phone + Phone string `json:"Phone,omitempty"` + + // Portal Role Level + PortalRole string `json:"PortalRole,omitempty"` + + // Profile + ProfileID string `json:"ProfileID,omitempty"` + + // Info Emails + ReceivesAdminEmails bool `json:"ReceivesAdminEmails,omitempty"` + + // Admin Info Emails + ReceivesAdminInfoEmails bool `json:"ReceivesAdminInfoEmails,omitempty"` + + // Email Sender Address + SenderEmail string `json:"SenderEmail,omitempty"` + + // Email Sender Name + SenderName string `json:"SenderName,omitempty"` + + // Email Signature + Signature string `json:"Signature,omitempty"` + + // Small Photo URL + SmallPhotoURL string `json:"SmallPhotoURL,omitempty"` + + // The time day starts + StartOfDay string `json:"StartOfDay,omitempty"` + + // Taxnexus Account + TelnexusAccount string `json:"TelnexusAccount,omitempty"` + + // Tenant ID associated with this user + TenantID string `json:"TenantID,omitempty"` + + // tenant users + TenantUsers []*TenantUser `json:"TenantUsers"` + + // Time Zone + TimeZone string `json:"TimeZone,omitempty"` + + // Title + Title string `json:"Title,omitempty"` + + // Role + UserRoleID string `json:"UserRoleID,omitempty"` + + // user roles + UserRoles []*UserRole `json:"UserRoles"` + + // User Type + UserType string `json:"UserType,omitempty"` + + // Username + Username string `json:"Username,omitempty"` +} + +// Validate validates this user +func (m *User) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTenantUsers(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUserRoles(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *User) validateAddress(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Address") + } + return err + } + } + + return nil +} + +func (m *User) validateTenantUsers(formats strfmt.Registry) error { + if swag.IsZero(m.TenantUsers) { // not required + return nil + } + + for i := 0; i < len(m.TenantUsers); i++ { + if swag.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 { + return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *User) validateUserRoles(formats strfmt.Registry) error { + if swag.IsZero(m.UserRoles) { // not required + return nil + } + + for i := 0; i < len(m.UserRoles); i++ { + if swag.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 { + return ve.ValidateName("UserRoles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this user based on the context it is used +func (m *User) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTenantUsers(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUserRoles(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *User) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.Address != nil { + if err := m.Address.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Address") + } + return err + } + } + + return nil +} + +func (m *User) contextValidateTenantUsers(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TenantUsers); i++ { + + if m.TenantUsers[i] != nil { + if err := m.TenantUsers[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *User) contextValidateUserRoles(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.UserRoles); i++ { + + if m.UserRoles[i] != nil { + if err := m.UserRoles[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("UserRoles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *User) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *User) UnmarshalBinary(b []byte) error { + var res User + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/cloud/cloud_models/user_response.go b/api/cloud/cloud_models/user_response.go new file mode 100644 index 0000000..ef55498 --- /dev/null +++ b/api/cloud/cloud_models/user_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cloud_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UserResponse An array Taxnexus user objects +// +// swagger:model UserResponse +type UserResponse struct { + + // data + Data []*User `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this user response +func (m *UserResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UserResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UserResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this user response based on the context it is used +func (m *UserResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UserResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UserResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UserResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UserResponse) UnmarshalBinary(b []byte) error { + var res UserResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/cloud/cloud_models/user_role.go b/api/cloud/cloud_models/user_role.go new file mode 100644 index 0000000..99e14ad --- /dev/null +++ b/api/cloud/cloud_models/user_role.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cloud_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" +) + +// UserRole Relationship object that connects user to a role +// +// swagger:model UserRole +type UserRole struct { + + // Account Id + AccountID string `json:"AccountID,omitempty"` + + // Linked role ID + Auth0RoleID string `json:"Auth0RoleID,omitempty"` + + // Auth0 User ID + Auth0UserID string `json:"Auth0UserID,omitempty"` + + // Company Name + CompanyName string `json:"CompanyName,omitempty"` + + // Contact ID + ContactID string `json:"ContactID,omitempty"` + + // Role description + RoleDescription string `json:"RoleDescription,omitempty"` + + // The Role ID + RoleID string `json:"RoleID,omitempty"` + + // Role Name + RoleName string `json:"RoleName,omitempty"` + + // Taxnexus Account Number + TelnexusAccount string `json:"TelnexusAccount,omitempty"` + + // User Email Address + UserEmail string `json:"UserEmail,omitempty"` + + // User Full Name + UserFullName string `json:"UserFullName,omitempty"` + + // The User ID + UserID string `json:"UserID,omitempty"` + + // Username + Username string `json:"Username,omitempty"` +} + +// Validate validates this user role +func (m *UserRole) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this user role based on context it is used +func (m *UserRole) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UserRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UserRole) UnmarshalBinary(b []byte) error { + var res UserRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/crm/crm_client/accounts/accounts_client.go b/api/crm/crm_client/accounts/accounts_client.go new file mode 100644 index 0000000..ae62d6c --- /dev/null +++ b/api/crm/crm_client/accounts/accounts_client.go @@ -0,0 +1,258 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new accounts API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for accounts 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 { + DeleteAccount(params *DeleteAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAccountOK, error) + + GetAccounts(params *GetAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountsOK, error) + + GetAccountsObservable(params *GetAccountsObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountsObservableOK, error) + + PostAccounts(params *PostAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAccountsOK, error) + + PutAccount(params *PutAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutAccountOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteAccount deletes an account + + Delete Telnexus Account record +*/ +func (a *Client) DeleteAccount(params *DeleteAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAccountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteAccountParams() + } + op := &runtime.ClientOperation{ + ID: "deleteAccount", + Method: "DELETE", + PathPattern: "/accounts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + 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) + if err != nil { + return nil, err + } + 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 + 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 +*/ +func (a *Client) GetAccounts(params *GetAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAccountsParams() + } + op := &runtime.ClientOperation{ + ID: "getAccounts", + Method: "GET", + PathPattern: "/accounts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + 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) + if err != nil { + return nil, err + } + 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 + 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) +} + +/* + GetAccountsObservable gets telnexus accounts in an observable array + + A list of accounts in a simple JSON array +*/ +func (a *Client) GetAccountsObservable(params *GetAccountsObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountsObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAccountsObservableParams() + } + op := &runtime.ClientOperation{ + ID: "getAccountsObservable", + Method: "GET", + PathPattern: "/accounts/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetAccountsObservableReader{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.(*GetAccountsObservableOK) + 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 getAccountsObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostAccounts adds a new account to telnexus + + Account record to be added +*/ +func (a *Client) PostAccounts(params *PostAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAccountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostAccountsParams() + } + op := &runtime.ClientOperation{ + ID: "postAccounts", + Method: "POST", + PathPattern: "/accounts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + 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) + if err != nil { + return nil, err + } + 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 + 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) +} + +/* + PutAccount updates a single account + + Update a single account specified by accountId +*/ +func (a *Client) PutAccount(params *PutAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutAccountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutAccountParams() + } + op := &runtime.ClientOperation{ + ID: "putAccount", + Method: "PUT", + PathPattern: "/accounts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutAccountReader{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.(*PutAccountOK) + 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 putAccount: 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 +} diff --git a/api/crm/crm_client/accounts/delete_account_parameters.go b/api/crm/crm_client/accounts/delete_account_parameters.go new file mode 100644 index 0000000..820808f --- /dev/null +++ b/api/crm/crm_client/accounts/delete_account_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteAccountParams creates a new DeleteAccountParams 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 NewDeleteAccountParams() *DeleteAccountParams { + return &DeleteAccountParams{ + timeout: 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, + } +} + +// NewDeleteAccountParamsWithContext creates a new DeleteAccountParams object +// with the ability to set a context for a request. +func NewDeleteAccountParamsWithContext(ctx context.Context) *DeleteAccountParams { + return &DeleteAccountParams{ + Context: ctx, + } +} + +// NewDeleteAccountParamsWithHTTPClient creates a new DeleteAccountParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteAccountParamsWithHTTPClient(client *http.Client) *DeleteAccountParams { + return &DeleteAccountParams{ + HTTPClient: client, + } +} + +/* DeleteAccountParams contains all the parameters to send to the API endpoint + for the delete account operation. + + Typically these are written to a http.Request. +*/ +type DeleteAccountParams struct { + + /* AccountID. + + Telnexus Record Id of an Account + */ + AccountID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteAccountParams) WithDefaults() *DeleteAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteAccountParams) SetDefaults() { + // no default values defined for this parameter +} + +// 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 +func (o *DeleteAccountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete account params +func (o *DeleteAccountParams) WithContext(ctx context.Context) *DeleteAccountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete account params +func (o *DeleteAccountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// 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 +func (o *DeleteAccountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// 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 +func (o *DeleteAccountParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteAccountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AccountID != nil { + + // query param accountId + var qrAccountID string + + if o.AccountID != nil { + qrAccountID = *o.AccountID + } + qAccountID := qrAccountID + if qAccountID != "" { + + if err := r.SetQueryParam("accountId", qAccountID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/crm/crm_client/accounts/delete_account_responses.go b/api/crm/crm_client/accounts/delete_account_responses.go new file mode 100644 index 0000000..b53b39a --- /dev/null +++ b/api/crm/crm_client/accounts/delete_account_responses.go @@ -0,0 +1,315 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/crm/crm_models" +) + +// DeleteAccountReader is a Reader for the DeleteAccount structure. +type DeleteAccountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteAccountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteAccountOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeleteAccountUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteAccountForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteAccountNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewDeleteAccountUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteAccountInternalServerError() + 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()) + } +} + +// NewDeleteAccountOK creates a DeleteAccountOK with default headers values +func NewDeleteAccountOK() *DeleteAccountOK { + return &DeleteAccountOK{} +} + +/* DeleteAccountOK describes a response with status code 200, with default header values. + +Telnexus Response with Message Objects with Delete Status +*/ +type DeleteAccountOK struct { + AccessControlAllowOrigin string + + Payload *crm_models.DeleteResponse +} + +func (o *DeleteAccountOK) Error() string { + return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountOK %+v", 200, o.Payload) +} +func (o *DeleteAccountOK) GetPayload() *crm_models.DeleteResponse { + return o.Payload +} + +func (o *DeleteAccountOK) 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.DeleteResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteAccountUnauthorized creates a DeleteAccountUnauthorized with default headers values +func NewDeleteAccountUnauthorized() *DeleteAccountUnauthorized { + return &DeleteAccountUnauthorized{} +} + +/* DeleteAccountUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type DeleteAccountUnauthorized struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *DeleteAccountUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountUnauthorized %+v", 401, o.Payload) +} +func (o *DeleteAccountUnauthorized) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *DeleteAccountUnauthorized) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteAccountForbidden creates a DeleteAccountForbidden with default headers values +func NewDeleteAccountForbidden() *DeleteAccountForbidden { + return &DeleteAccountForbidden{} +} + +/* DeleteAccountForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type DeleteAccountForbidden struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *DeleteAccountForbidden) Error() string { + return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountForbidden %+v", 403, o.Payload) +} +func (o *DeleteAccountForbidden) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *DeleteAccountForbidden) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteAccountNotFound creates a DeleteAccountNotFound with default headers values +func NewDeleteAccountNotFound() *DeleteAccountNotFound { + return &DeleteAccountNotFound{} +} + +/* DeleteAccountNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type DeleteAccountNotFound struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *DeleteAccountNotFound) Error() string { + return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountNotFound %+v", 404, o.Payload) +} +func (o *DeleteAccountNotFound) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *DeleteAccountNotFound) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteAccountUnprocessableEntity creates a DeleteAccountUnprocessableEntity with default headers values +func NewDeleteAccountUnprocessableEntity() *DeleteAccountUnprocessableEntity { + return &DeleteAccountUnprocessableEntity{} +} + +/* DeleteAccountUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type DeleteAccountUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *DeleteAccountUnprocessableEntity) Error() string { + return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountUnprocessableEntity %+v", 422, o.Payload) +} +func (o *DeleteAccountUnprocessableEntity) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *DeleteAccountUnprocessableEntity) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteAccountInternalServerError creates a DeleteAccountInternalServerError with default headers values +func NewDeleteAccountInternalServerError() *DeleteAccountInternalServerError { + return &DeleteAccountInternalServerError{} +} + +/* DeleteAccountInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type DeleteAccountInternalServerError struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *DeleteAccountInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountInternalServerError %+v", 500, o.Payload) +} +func (o *DeleteAccountInternalServerError) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *DeleteAccountInternalServerError) 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 && err != io.EOF { + return err + } + + return nil +} diff --git a/api/crm/crm_client/accounts/get_accounts_observable_parameters.go b/api/crm/crm_client/accounts/get_accounts_observable_parameters.go new file mode 100644 index 0000000..efd7ad7 --- /dev/null +++ b/api/crm/crm_client/accounts/get_accounts_observable_parameters.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + + "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" +) + +// NewGetAccountsObservableParams creates a new GetAccountsObservableParams 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 NewGetAccountsObservableParams() *GetAccountsObservableParams { + return &GetAccountsObservableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAccountsObservableParamsWithTimeout creates a new GetAccountsObservableParams object +// with the ability to set a timeout on a request. +func NewGetAccountsObservableParamsWithTimeout(timeout time.Duration) *GetAccountsObservableParams { + return &GetAccountsObservableParams{ + timeout: timeout, + } +} + +// NewGetAccountsObservableParamsWithContext creates a new GetAccountsObservableParams object +// with the ability to set a context for a request. +func NewGetAccountsObservableParamsWithContext(ctx context.Context) *GetAccountsObservableParams { + return &GetAccountsObservableParams{ + Context: ctx, + } +} + +// NewGetAccountsObservableParamsWithHTTPClient creates a new GetAccountsObservableParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAccountsObservableParamsWithHTTPClient(client *http.Client) *GetAccountsObservableParams { + return &GetAccountsObservableParams{ + HTTPClient: client, + } +} + +/* GetAccountsObservableParams contains all the parameters to send to the API endpoint + for the get accounts observable operation. + + Typically these are written to a http.Request. +*/ +type GetAccountsObservableParams struct { + + /* AccountID. + + Telnexus Record Id of an Account + */ + AccountID *string + + /* Active. + + Only retrieve active records? + */ + Active *bool + + /* Email. + + Email address used for identity lookup + */ + Email *string + + /* Name. + + The Name of this Object + */ + Name *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get accounts observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountsObservableParams) WithDefaults() *GetAccountsObservableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get accounts observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountsObservableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get accounts observable params +func (o *GetAccountsObservableParams) WithTimeout(timeout time.Duration) *GetAccountsObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get accounts observable params +func (o *GetAccountsObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get accounts observable params +func (o *GetAccountsObservableParams) WithContext(ctx context.Context) *GetAccountsObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get accounts observable params +func (o *GetAccountsObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get accounts observable params +func (o *GetAccountsObservableParams) WithHTTPClient(client *http.Client) *GetAccountsObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get accounts observable params +func (o *GetAccountsObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get accounts observable params +func (o *GetAccountsObservableParams) WithAccountID(accountID *string) *GetAccountsObservableParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get accounts observable params +func (o *GetAccountsObservableParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithActive adds the active to the get accounts observable params +func (o *GetAccountsObservableParams) WithActive(active *bool) *GetAccountsObservableParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get accounts observable params +func (o *GetAccountsObservableParams) SetActive(active *bool) { + o.Active = active +} + +// WithEmail adds the email to the get accounts observable params +func (o *GetAccountsObservableParams) WithEmail(email *string) *GetAccountsObservableParams { + o.SetEmail(email) + return o +} + +// SetEmail adds the email to the get accounts observable params +func (o *GetAccountsObservableParams) SetEmail(email *string) { + o.Email = email +} + +// WithName adds the name to the get accounts observable params +func (o *GetAccountsObservableParams) WithName(name *string) *GetAccountsObservableParams { + o.SetName(name) + return o +} + +// SetName adds the name to the get accounts observable params +func (o *GetAccountsObservableParams) SetName(name *string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAccountsObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AccountID != nil { + + // query param accountId + var qrAccountID string + + if o.AccountID != nil { + qrAccountID = *o.AccountID + } + qAccountID := qrAccountID + if qAccountID != "" { + + if err := r.SetQueryParam("accountId", qAccountID); err != nil { + return err + } + } + } + + if o.Active != nil { + + // query param active + var qrActive bool + + if o.Active != nil { + qrActive = *o.Active + } + qActive := swag.FormatBool(qrActive) + if qActive != "" { + + if err := r.SetQueryParam("active", qActive); err != nil { + return err + } + } + } + + if o.Email != nil { + + // query param email + var qrEmail string + + if o.Email != nil { + qrEmail = *o.Email + } + qEmail := qrEmail + if qEmail != "" { + + if err := r.SetQueryParam("email", qEmail); err != nil { + return err + } + } + } + + if o.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/crm/crm_client/accounts/get_accounts_observable_responses.go b/api/crm/crm_client/accounts/get_accounts_observable_responses.go new file mode 100644 index 0000000..feeaa17 --- /dev/null +++ b/api/crm/crm_client/accounts/get_accounts_observable_responses.go @@ -0,0 +1,321 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/crm/crm_models" +) + +// GetAccountsObservableReader is a Reader for the GetAccountsObservable structure. +type GetAccountsObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAccountsObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAccountsObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetAccountsObservableUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetAccountsObservableForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetAccountsObservableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetAccountsObservableUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetAccountsObservableInternalServerError() + 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()) + } +} + +// NewGetAccountsObservableOK creates a GetAccountsObservableOK with default headers values +func NewGetAccountsObservableOK() *GetAccountsObservableOK { + return &GetAccountsObservableOK{} +} + +/* GetAccountsObservableOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of Account objects +*/ +type GetAccountsObservableOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload []*crm_models.Account +} + +func (o *GetAccountsObservableOK) Error() string { + return fmt.Sprintf("[GET /accounts/observable][%d] getAccountsObservableOK %+v", 200, o.Payload) +} +func (o *GetAccountsObservableOK) GetPayload() []*crm_models.Account { + return o.Payload +} + +func (o *GetAccountsObservableOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountsObservableUnauthorized creates a GetAccountsObservableUnauthorized with default headers values +func NewGetAccountsObservableUnauthorized() *GetAccountsObservableUnauthorized { + return &GetAccountsObservableUnauthorized{} +} + +/* GetAccountsObservableUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetAccountsObservableUnauthorized struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetAccountsObservableUnauthorized) Error() string { + return fmt.Sprintf("[GET /accounts/observable][%d] getAccountsObservableUnauthorized %+v", 401, o.Payload) +} +func (o *GetAccountsObservableUnauthorized) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetAccountsObservableUnauthorized) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountsObservableForbidden creates a GetAccountsObservableForbidden with default headers values +func NewGetAccountsObservableForbidden() *GetAccountsObservableForbidden { + return &GetAccountsObservableForbidden{} +} + +/* GetAccountsObservableForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetAccountsObservableForbidden struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetAccountsObservableForbidden) Error() string { + return fmt.Sprintf("[GET /accounts/observable][%d] getAccountsObservableForbidden %+v", 403, o.Payload) +} +func (o *GetAccountsObservableForbidden) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetAccountsObservableForbidden) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountsObservableNotFound creates a GetAccountsObservableNotFound with default headers values +func NewGetAccountsObservableNotFound() *GetAccountsObservableNotFound { + return &GetAccountsObservableNotFound{} +} + +/* GetAccountsObservableNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetAccountsObservableNotFound struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetAccountsObservableNotFound) Error() string { + return fmt.Sprintf("[GET /accounts/observable][%d] getAccountsObservableNotFound %+v", 404, o.Payload) +} +func (o *GetAccountsObservableNotFound) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetAccountsObservableNotFound) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountsObservableUnprocessableEntity creates a GetAccountsObservableUnprocessableEntity with default headers values +func NewGetAccountsObservableUnprocessableEntity() *GetAccountsObservableUnprocessableEntity { + return &GetAccountsObservableUnprocessableEntity{} +} + +/* GetAccountsObservableUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetAccountsObservableUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetAccountsObservableUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /accounts/observable][%d] getAccountsObservableUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetAccountsObservableUnprocessableEntity) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetAccountsObservableUnprocessableEntity) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountsObservableInternalServerError creates a GetAccountsObservableInternalServerError with default headers values +func NewGetAccountsObservableInternalServerError() *GetAccountsObservableInternalServerError { + return &GetAccountsObservableInternalServerError{} +} + +/* GetAccountsObservableInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetAccountsObservableInternalServerError struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetAccountsObservableInternalServerError) Error() string { + return fmt.Sprintf("[GET /accounts/observable][%d] getAccountsObservableInternalServerError %+v", 500, o.Payload) +} +func (o *GetAccountsObservableInternalServerError) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetAccountsObservableInternalServerError) 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 && err != io.EOF { + return err + } + + return nil +} diff --git a/api/crm/crm_client/accounts/get_accounts_parameters.go b/api/crm/crm_client/accounts/get_accounts_parameters.go new file mode 100644 index 0000000..0de9c4f --- /dev/null +++ b/api/crm/crm_client/accounts/get_accounts_parameters.go @@ -0,0 +1,340 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + + "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" +) + +// NewGetAccountsParams creates a new GetAccountsParams 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 NewGetAccountsParams() *GetAccountsParams { + return &GetAccountsParams{ + timeout: 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, + } +} + +// NewGetAccountsParamsWithContext creates a new GetAccountsParams object +// with the ability to set a context for a request. +func NewGetAccountsParamsWithContext(ctx context.Context) *GetAccountsParams { + return &GetAccountsParams{ + Context: ctx, + } +} + +// NewGetAccountsParamsWithHTTPClient creates a new GetAccountsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAccountsParamsWithHTTPClient(client *http.Client) *GetAccountsParams { + return &GetAccountsParams{ + HTTPClient: client, + } +} + +/* GetAccountsParams contains all the parameters to send to the API endpoint + for the get accounts operation. + + Typically these are written to a http.Request. +*/ +type GetAccountsParams struct { + + /* AccountID. + + Telnexus Record Id of an Account + */ + AccountID *string + + /* Active. + + Only retrieve active records? + */ + Active *bool + + /* Email. + + Email address used for identity lookup + */ + Email *string + + /* Limit. + + How many objects to return at one time + + Format: int64 + */ + Limit *int64 + + /* Name. + + The Name of this Object + */ + Name *string + + /* 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 accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountsParams) WithDefaults() *GetAccountsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountsParams) SetDefaults() { + // no default values defined for this parameter +} + +// 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 +func (o *GetAccountsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get accounts params +func (o *GetAccountsParams) WithContext(ctx context.Context) *GetAccountsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get accounts params +func (o *GetAccountsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// 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 +func (o *GetAccountsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// 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 +func (o *GetAccountsParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// 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 +func (o *GetAccountsParams) SetActive(active *bool) { + o.Active = active +} + +// WithEmail adds the email to the get accounts params +func (o *GetAccountsParams) WithEmail(email *string) *GetAccountsParams { + o.SetEmail(email) + return o +} + +// SetEmail adds the email to the get accounts params +func (o *GetAccountsParams) SetEmail(email *string) { + o.Email = email +} + +// 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 +func (o *GetAccountsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// 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 +func (o *GetAccountsParams) SetName(name *string) { + o.Name = name +} + +// 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 +func (o *GetAccountsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AccountID != nil { + + // query param accountId + var qrAccountID string + + if o.AccountID != nil { + qrAccountID = *o.AccountID + } + qAccountID := qrAccountID + if qAccountID != "" { + + if err := r.SetQueryParam("accountId", qAccountID); err != nil { + return err + } + } + } + + if o.Active != nil { + + // query param active + var qrActive bool + + if o.Active != nil { + qrActive = *o.Active + } + qActive := swag.FormatBool(qrActive) + if qActive != "" { + + if err := r.SetQueryParam("active", qActive); err != nil { + return err + } + } + } + + if o.Email != nil { + + // query param email + var qrEmail string + + if o.Email != nil { + qrEmail = *o.Email + } + qEmail := qrEmail + if qEmail != "" { + + if err := r.SetQueryParam("email", qEmail); 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.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); 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 +} diff --git a/api/crm/crm_client/accounts/get_accounts_responses.go b/api/crm/crm_client/accounts/get_accounts_responses.go new file mode 100644 index 0000000..5a82ce1 --- /dev/null +++ b/api/crm/crm_client/accounts/get_accounts_responses.go @@ -0,0 +1,323 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/crm/crm_models" +) + +// GetAccountsReader is a Reader for the GetAccounts structure. +type GetAccountsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAccountsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetAccountsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetAccountsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetAccountsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetAccountsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetAccountsInternalServerError() + 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()) + } +} + +// NewGetAccountsOK creates a GetAccountsOK with default headers values +func NewGetAccountsOK() *GetAccountsOK { + return &GetAccountsOK{} +} + +/* GetAccountsOK describes a response with status code 200, with default header values. + +Telnexus Response with Account objects with Contacts +*/ +type GetAccountsOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *crm_models.AccountResponse +} + +func (o *GetAccountsOK) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getAccountsOK %+v", 200, o.Payload) +} +func (o *GetAccountsOK) GetPayload() *crm_models.AccountResponse { + return o.Payload +} + +func (o *GetAccountsOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(crm_models.AccountResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountsUnauthorized creates a GetAccountsUnauthorized with default headers values +func NewGetAccountsUnauthorized() *GetAccountsUnauthorized { + return &GetAccountsUnauthorized{} +} + +/* GetAccountsUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetAccountsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetAccountsUnauthorized) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getAccountsUnauthorized %+v", 401, o.Payload) +} +func (o *GetAccountsUnauthorized) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetAccountsUnauthorized) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountsForbidden creates a GetAccountsForbidden with default headers values +func NewGetAccountsForbidden() *GetAccountsForbidden { + return &GetAccountsForbidden{} +} + +/* GetAccountsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetAccountsForbidden struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetAccountsForbidden) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getAccountsForbidden %+v", 403, o.Payload) +} +func (o *GetAccountsForbidden) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetAccountsForbidden) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountsNotFound creates a GetAccountsNotFound with default headers values +func NewGetAccountsNotFound() *GetAccountsNotFound { + return &GetAccountsNotFound{} +} + +/* GetAccountsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetAccountsNotFound struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetAccountsNotFound) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getAccountsNotFound %+v", 404, o.Payload) +} +func (o *GetAccountsNotFound) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetAccountsNotFound) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountsUnprocessableEntity creates a GetAccountsUnprocessableEntity with default headers values +func NewGetAccountsUnprocessableEntity() *GetAccountsUnprocessableEntity { + return &GetAccountsUnprocessableEntity{} +} + +/* GetAccountsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetAccountsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetAccountsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getAccountsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetAccountsUnprocessableEntity) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetAccountsUnprocessableEntity) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountsInternalServerError creates a GetAccountsInternalServerError with default headers values +func NewGetAccountsInternalServerError() *GetAccountsInternalServerError { + return &GetAccountsInternalServerError{} +} + +/* GetAccountsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetAccountsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetAccountsInternalServerError) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getAccountsInternalServerError %+v", 500, o.Payload) +} +func (o *GetAccountsInternalServerError) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetAccountsInternalServerError) 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 && err != io.EOF { + return err + } + + return nil +} diff --git a/api/crm/crm_client/accounts/post_accounts_parameters.go b/api/crm/crm_client/accounts/post_accounts_parameters.go new file mode 100644 index 0000000..f2c31ad --- /dev/null +++ b/api/crm/crm_client/accounts/post_accounts_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + + "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/telnexus/lib/api/crm/crm_models" +) + +// NewPostAccountsParams creates a new PostAccountsParams 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 NewPostAccountsParams() *PostAccountsParams { + return &PostAccountsParams{ + timeout: 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, + } +} + +// NewPostAccountsParamsWithContext creates a new PostAccountsParams object +// with the ability to set a context for a request. +func NewPostAccountsParamsWithContext(ctx context.Context) *PostAccountsParams { + return &PostAccountsParams{ + Context: ctx, + } +} + +// NewPostAccountsParamsWithHTTPClient creates a new PostAccountsParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostAccountsParamsWithHTTPClient(client *http.Client) *PostAccountsParams { + return &PostAccountsParams{ + HTTPClient: client, + } +} + +/* PostAccountsParams contains all the parameters to send to the API endpoint + for the post accounts operation. + + Typically these are written to a http.Request. +*/ +type PostAccountsParams struct { + + /* AccountRequest. + + An array of new Account records + */ + AccountRequest *crm_models.AccountRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostAccountsParams) WithDefaults() *PostAccountsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostAccountsParams) SetDefaults() { + // no default values defined for this parameter +} + +// 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 +func (o *PostAccountsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post accounts params +func (o *PostAccountsParams) WithContext(ctx context.Context) *PostAccountsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post accounts params +func (o *PostAccountsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// 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 +func (o *PostAccountsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// 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 +func (o *PostAccountsParams) SetAccountRequest(accountRequest *crm_models.AccountRequest) { + o.AccountRequest = accountRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.AccountRequest != nil { + if err := r.SetBodyParam(o.AccountRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/crm/crm_client/accounts/post_accounts_responses.go b/api/crm/crm_client/accounts/post_accounts_responses.go new file mode 100644 index 0000000..43d016d --- /dev/null +++ b/api/crm/crm_client/accounts/post_accounts_responses.go @@ -0,0 +1,323 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/crm/crm_models" +) + +// PostAccountsReader is a Reader for the PostAccounts structure. +type PostAccountsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostAccountsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostAccountsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostAccountsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostAccountsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostAccountsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostAccountsInternalServerError() + 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()) + } +} + +// NewPostAccountsOK creates a PostAccountsOK with default headers values +func NewPostAccountsOK() *PostAccountsOK { + return &PostAccountsOK{} +} + +/* PostAccountsOK describes a response with status code 200, with default header values. + +Telnexus Response with Account objects with Contacts +*/ +type PostAccountsOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *crm_models.AccountResponse +} + +func (o *PostAccountsOK) Error() string { + return fmt.Sprintf("[POST /accounts][%d] postAccountsOK %+v", 200, o.Payload) +} +func (o *PostAccountsOK) GetPayload() *crm_models.AccountResponse { + return o.Payload +} + +func (o *PostAccountsOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(crm_models.AccountResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAccountsUnauthorized creates a PostAccountsUnauthorized with default headers values +func NewPostAccountsUnauthorized() *PostAccountsUnauthorized { + return &PostAccountsUnauthorized{} +} + +/* PostAccountsUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostAccountsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PostAccountsUnauthorized) Error() string { + return fmt.Sprintf("[POST /accounts][%d] postAccountsUnauthorized %+v", 401, o.Payload) +} +func (o *PostAccountsUnauthorized) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PostAccountsUnauthorized) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPostAccountsForbidden creates a PostAccountsForbidden with default headers values +func NewPostAccountsForbidden() *PostAccountsForbidden { + return &PostAccountsForbidden{} +} + +/* PostAccountsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostAccountsForbidden struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PostAccountsForbidden) Error() string { + return fmt.Sprintf("[POST /accounts][%d] postAccountsForbidden %+v", 403, o.Payload) +} +func (o *PostAccountsForbidden) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PostAccountsForbidden) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPostAccountsNotFound creates a PostAccountsNotFound with default headers values +func NewPostAccountsNotFound() *PostAccountsNotFound { + return &PostAccountsNotFound{} +} + +/* PostAccountsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostAccountsNotFound struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PostAccountsNotFound) Error() string { + return fmt.Sprintf("[POST /accounts][%d] postAccountsNotFound %+v", 404, o.Payload) +} +func (o *PostAccountsNotFound) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PostAccountsNotFound) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPostAccountsUnprocessableEntity creates a PostAccountsUnprocessableEntity with default headers values +func NewPostAccountsUnprocessableEntity() *PostAccountsUnprocessableEntity { + return &PostAccountsUnprocessableEntity{} +} + +/* PostAccountsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostAccountsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PostAccountsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /accounts][%d] postAccountsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PostAccountsUnprocessableEntity) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PostAccountsUnprocessableEntity) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPostAccountsInternalServerError creates a PostAccountsInternalServerError with default headers values +func NewPostAccountsInternalServerError() *PostAccountsInternalServerError { + return &PostAccountsInternalServerError{} +} + +/* PostAccountsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostAccountsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PostAccountsInternalServerError) Error() string { + return fmt.Sprintf("[POST /accounts][%d] postAccountsInternalServerError %+v", 500, o.Payload) +} +func (o *PostAccountsInternalServerError) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PostAccountsInternalServerError) 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 && err != io.EOF { + return err + } + + return nil +} diff --git a/api/crm/crm_client/accounts/put_account_parameters.go b/api/crm/crm_client/accounts/put_account_parameters.go new file mode 100644 index 0000000..9fa14aa --- /dev/null +++ b/api/crm/crm_client/accounts/put_account_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + + "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/telnexus/lib/api/crm/crm_models" +) + +// NewPutAccountParams creates a new PutAccountParams 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 NewPutAccountParams() *PutAccountParams { + return &PutAccountParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPutAccountParamsWithTimeout creates a new PutAccountParams object +// with the ability to set a timeout on a request. +func NewPutAccountParamsWithTimeout(timeout time.Duration) *PutAccountParams { + return &PutAccountParams{ + timeout: timeout, + } +} + +// NewPutAccountParamsWithContext creates a new PutAccountParams object +// with the ability to set a context for a request. +func NewPutAccountParamsWithContext(ctx context.Context) *PutAccountParams { + return &PutAccountParams{ + Context: ctx, + } +} + +// NewPutAccountParamsWithHTTPClient creates a new PutAccountParams object +// with the ability to set a custom HTTPClient for a request. +func NewPutAccountParamsWithHTTPClient(client *http.Client) *PutAccountParams { + return &PutAccountParams{ + HTTPClient: client, + } +} + +/* PutAccountParams contains all the parameters to send to the API endpoint + for the put account operation. + + Typically these are written to a http.Request. +*/ +type PutAccountParams struct { + + /* AccountRequest. + + An array of new Account records + */ + AccountRequest *crm_models.AccountRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutAccountParams) WithDefaults() *PutAccountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put account params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutAccountParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the put account params +func (o *PutAccountParams) WithTimeout(timeout time.Duration) *PutAccountParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put account params +func (o *PutAccountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put account params +func (o *PutAccountParams) WithContext(ctx context.Context) *PutAccountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put account params +func (o *PutAccountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put account params +func (o *PutAccountParams) WithHTTPClient(client *http.Client) *PutAccountParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put account params +func (o *PutAccountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountRequest adds the accountRequest to the put account params +func (o *PutAccountParams) WithAccountRequest(accountRequest *crm_models.AccountRequest) *PutAccountParams { + o.SetAccountRequest(accountRequest) + return o +} + +// SetAccountRequest adds the accountRequest to the put account params +func (o *PutAccountParams) SetAccountRequest(accountRequest *crm_models.AccountRequest) { + o.AccountRequest = accountRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutAccountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.AccountRequest != nil { + if err := r.SetBodyParam(o.AccountRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/crm/crm_client/accounts/put_account_responses.go b/api/crm/crm_client/accounts/put_account_responses.go new file mode 100644 index 0000000..831b515 --- /dev/null +++ b/api/crm/crm_client/accounts/put_account_responses.go @@ -0,0 +1,323 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/crm/crm_models" +) + +// PutAccountReader is a Reader for the PutAccount structure. +type PutAccountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutAccountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutAccountOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutAccountUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutAccountForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutAccountNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutAccountUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutAccountInternalServerError() + 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()) + } +} + +// NewPutAccountOK creates a PutAccountOK with default headers values +func NewPutAccountOK() *PutAccountOK { + return &PutAccountOK{} +} + +/* PutAccountOK describes a response with status code 200, with default header values. + +Telnexus Response with Account objects with Contacts +*/ +type PutAccountOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *crm_models.AccountResponse +} + +func (o *PutAccountOK) Error() string { + return fmt.Sprintf("[PUT /accounts][%d] putAccountOK %+v", 200, o.Payload) +} +func (o *PutAccountOK) GetPayload() *crm_models.AccountResponse { + return o.Payload +} + +func (o *PutAccountOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(crm_models.AccountResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAccountUnauthorized creates a PutAccountUnauthorized with default headers values +func NewPutAccountUnauthorized() *PutAccountUnauthorized { + return &PutAccountUnauthorized{} +} + +/* PutAccountUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutAccountUnauthorized struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PutAccountUnauthorized) Error() string { + return fmt.Sprintf("[PUT /accounts][%d] putAccountUnauthorized %+v", 401, o.Payload) +} +func (o *PutAccountUnauthorized) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PutAccountUnauthorized) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPutAccountForbidden creates a PutAccountForbidden with default headers values +func NewPutAccountForbidden() *PutAccountForbidden { + return &PutAccountForbidden{} +} + +/* PutAccountForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PutAccountForbidden struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PutAccountForbidden) Error() string { + return fmt.Sprintf("[PUT /accounts][%d] putAccountForbidden %+v", 403, o.Payload) +} +func (o *PutAccountForbidden) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PutAccountForbidden) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPutAccountNotFound creates a PutAccountNotFound with default headers values +func NewPutAccountNotFound() *PutAccountNotFound { + return &PutAccountNotFound{} +} + +/* PutAccountNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PutAccountNotFound struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PutAccountNotFound) Error() string { + return fmt.Sprintf("[PUT /accounts][%d] putAccountNotFound %+v", 404, o.Payload) +} +func (o *PutAccountNotFound) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PutAccountNotFound) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPutAccountUnprocessableEntity creates a PutAccountUnprocessableEntity with default headers values +func NewPutAccountUnprocessableEntity() *PutAccountUnprocessableEntity { + return &PutAccountUnprocessableEntity{} +} + +/* PutAccountUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutAccountUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PutAccountUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /accounts][%d] putAccountUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PutAccountUnprocessableEntity) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PutAccountUnprocessableEntity) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPutAccountInternalServerError creates a PutAccountInternalServerError with default headers values +func NewPutAccountInternalServerError() *PutAccountInternalServerError { + return &PutAccountInternalServerError{} +} + +/* PutAccountInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PutAccountInternalServerError struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PutAccountInternalServerError) Error() string { + return fmt.Sprintf("[PUT /accounts][%d] putAccountInternalServerError %+v", 500, o.Payload) +} +func (o *PutAccountInternalServerError) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PutAccountInternalServerError) 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 && err != io.EOF { + return err + } + + return nil +} diff --git a/api/crm/crm_client/companies/companies_client.go b/api/crm/crm_client/companies/companies_client.go new file mode 100644 index 0000000..f7e52e1 --- /dev/null +++ b/api/crm/crm_client/companies/companies_client.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package companies + +// 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 companies API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for companies 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 { + GetCompanies(params *GetCompaniesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCompaniesOK, error) + + GetCompaniesObservable(params *GetCompaniesObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCompaniesObservableOK, error) + + PostCompanies(params *PostCompaniesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostCompaniesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetCompanies gets company records + + Retrieve Company records from the datastore +*/ +func (a *Client) GetCompanies(params *GetCompaniesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCompaniesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCompaniesParams() + } + op := &runtime.ClientOperation{ + ID: "getCompanies", + Method: "GET", + PathPattern: "/companies", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCompaniesReader{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.(*GetCompaniesOK) + 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 getCompanies: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetCompaniesObservable gets telnexus companies in an observable array + + A list of companies in a simple JSON array +*/ +func (a *Client) GetCompaniesObservable(params *GetCompaniesObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCompaniesObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCompaniesObservableParams() + } + op := &runtime.ClientOperation{ + ID: "getCompaniesObservable", + Method: "GET", + PathPattern: "/companies/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCompaniesObservableReader{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.(*GetCompaniesObservableOK) + 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 getCompaniesObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostCompanies adds new companies + + Add new companies +*/ +func (a *Client) PostCompanies(params *PostCompaniesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostCompaniesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostCompaniesParams() + } + op := &runtime.ClientOperation{ + ID: "postCompanies", + Method: "POST", + PathPattern: "/companies", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostCompaniesReader{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.(*PostCompaniesOK) + 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 postCompanies: 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 +} diff --git a/api/crm/crm_client/companies/get_companies_observable_parameters.go b/api/crm/crm_client/companies/get_companies_observable_parameters.go new file mode 100644 index 0000000..1e663ee --- /dev/null +++ b/api/crm/crm_client/companies/get_companies_observable_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package companies + +// 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" +) + +// NewGetCompaniesObservableParams creates a new GetCompaniesObservableParams 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 NewGetCompaniesObservableParams() *GetCompaniesObservableParams { + return &GetCompaniesObservableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetCompaniesObservableParamsWithTimeout creates a new GetCompaniesObservableParams object +// with the ability to set a timeout on a request. +func NewGetCompaniesObservableParamsWithTimeout(timeout time.Duration) *GetCompaniesObservableParams { + return &GetCompaniesObservableParams{ + timeout: timeout, + } +} + +// NewGetCompaniesObservableParamsWithContext creates a new GetCompaniesObservableParams object +// with the ability to set a context for a request. +func NewGetCompaniesObservableParamsWithContext(ctx context.Context) *GetCompaniesObservableParams { + return &GetCompaniesObservableParams{ + Context: ctx, + } +} + +// NewGetCompaniesObservableParamsWithHTTPClient creates a new GetCompaniesObservableParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetCompaniesObservableParamsWithHTTPClient(client *http.Client) *GetCompaniesObservableParams { + return &GetCompaniesObservableParams{ + HTTPClient: client, + } +} + +/* GetCompaniesObservableParams contains all the parameters to send to the API endpoint + for the get companies observable operation. + + Typically these are written to a http.Request. +*/ +type GetCompaniesObservableParams struct { + + /* CompanyID. + + Telnexus Company record ID + */ + CompanyID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get companies observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCompaniesObservableParams) WithDefaults() *GetCompaniesObservableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get companies observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCompaniesObservableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get companies observable params +func (o *GetCompaniesObservableParams) WithTimeout(timeout time.Duration) *GetCompaniesObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get companies observable params +func (o *GetCompaniesObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get companies observable params +func (o *GetCompaniesObservableParams) WithContext(ctx context.Context) *GetCompaniesObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get companies observable params +func (o *GetCompaniesObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get companies observable params +func (o *GetCompaniesObservableParams) WithHTTPClient(client *http.Client) *GetCompaniesObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get companies observable params +func (o *GetCompaniesObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCompanyID adds the companyID to the get companies observable params +func (o *GetCompaniesObservableParams) WithCompanyID(companyID *string) *GetCompaniesObservableParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get companies observable params +func (o *GetCompaniesObservableParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCompaniesObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CompanyID != nil { + + // query param companyId + var qrCompanyID string + + if o.CompanyID != nil { + qrCompanyID = *o.CompanyID + } + qCompanyID := qrCompanyID + if qCompanyID != "" { + + if err := r.SetQueryParam("companyId", qCompanyID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/crm/crm_client/companies/get_companies_observable_responses.go b/api/crm/crm_client/companies/get_companies_observable_responses.go new file mode 100644 index 0000000..66ab06c --- /dev/null +++ b/api/crm/crm_client/companies/get_companies_observable_responses.go @@ -0,0 +1,321 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package companies + +// 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/telnexus/lib/api/crm/crm_models" +) + +// GetCompaniesObservableReader is a Reader for the GetCompaniesObservable structure. +type GetCompaniesObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCompaniesObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCompaniesObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetCompaniesObservableUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetCompaniesObservableForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetCompaniesObservableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetCompaniesObservableUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetCompaniesObservableInternalServerError() + 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()) + } +} + +// NewGetCompaniesObservableOK creates a GetCompaniesObservableOK with default headers values +func NewGetCompaniesObservableOK() *GetCompaniesObservableOK { + return &GetCompaniesObservableOK{} +} + +/* GetCompaniesObservableOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of Company objects +*/ +type GetCompaniesObservableOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload []*crm_models.Company +} + +func (o *GetCompaniesObservableOK) Error() string { + return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableOK %+v", 200, o.Payload) +} +func (o *GetCompaniesObservableOK) GetPayload() []*crm_models.Company { + return o.Payload +} + +func (o *GetCompaniesObservableOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCompaniesObservableUnauthorized creates a GetCompaniesObservableUnauthorized with default headers values +func NewGetCompaniesObservableUnauthorized() *GetCompaniesObservableUnauthorized { + return &GetCompaniesObservableUnauthorized{} +} + +/* GetCompaniesObservableUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetCompaniesObservableUnauthorized struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetCompaniesObservableUnauthorized) Error() string { + return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableUnauthorized %+v", 401, o.Payload) +} +func (o *GetCompaniesObservableUnauthorized) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetCompaniesObservableUnauthorized) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetCompaniesObservableForbidden creates a GetCompaniesObservableForbidden with default headers values +func NewGetCompaniesObservableForbidden() *GetCompaniesObservableForbidden { + return &GetCompaniesObservableForbidden{} +} + +/* GetCompaniesObservableForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetCompaniesObservableForbidden struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetCompaniesObservableForbidden) Error() string { + return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableForbidden %+v", 403, o.Payload) +} +func (o *GetCompaniesObservableForbidden) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetCompaniesObservableForbidden) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetCompaniesObservableNotFound creates a GetCompaniesObservableNotFound with default headers values +func NewGetCompaniesObservableNotFound() *GetCompaniesObservableNotFound { + return &GetCompaniesObservableNotFound{} +} + +/* GetCompaniesObservableNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetCompaniesObservableNotFound struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetCompaniesObservableNotFound) Error() string { + return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableNotFound %+v", 404, o.Payload) +} +func (o *GetCompaniesObservableNotFound) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetCompaniesObservableNotFound) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetCompaniesObservableUnprocessableEntity creates a GetCompaniesObservableUnprocessableEntity with default headers values +func NewGetCompaniesObservableUnprocessableEntity() *GetCompaniesObservableUnprocessableEntity { + return &GetCompaniesObservableUnprocessableEntity{} +} + +/* GetCompaniesObservableUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetCompaniesObservableUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetCompaniesObservableUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetCompaniesObservableUnprocessableEntity) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetCompaniesObservableUnprocessableEntity) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetCompaniesObservableInternalServerError creates a GetCompaniesObservableInternalServerError with default headers values +func NewGetCompaniesObservableInternalServerError() *GetCompaniesObservableInternalServerError { + return &GetCompaniesObservableInternalServerError{} +} + +/* GetCompaniesObservableInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetCompaniesObservableInternalServerError struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetCompaniesObservableInternalServerError) Error() string { + return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableInternalServerError %+v", 500, o.Payload) +} +func (o *GetCompaniesObservableInternalServerError) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetCompaniesObservableInternalServerError) 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 && err != io.EOF { + return err + } + + return nil +} diff --git a/api/crm/crm_client/companies/get_companies_parameters.go b/api/crm/crm_client/companies/get_companies_parameters.go new file mode 100644 index 0000000..f712ec6 --- /dev/null +++ b/api/crm/crm_client/companies/get_companies_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package companies + +// 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" +) + +// NewGetCompaniesParams creates a new GetCompaniesParams 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 NewGetCompaniesParams() *GetCompaniesParams { + return &GetCompaniesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetCompaniesParamsWithTimeout creates a new GetCompaniesParams object +// with the ability to set a timeout on a request. +func NewGetCompaniesParamsWithTimeout(timeout time.Duration) *GetCompaniesParams { + return &GetCompaniesParams{ + timeout: timeout, + } +} + +// NewGetCompaniesParamsWithContext creates a new GetCompaniesParams object +// with the ability to set a context for a request. +func NewGetCompaniesParamsWithContext(ctx context.Context) *GetCompaniesParams { + return &GetCompaniesParams{ + Context: ctx, + } +} + +// NewGetCompaniesParamsWithHTTPClient creates a new GetCompaniesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetCompaniesParamsWithHTTPClient(client *http.Client) *GetCompaniesParams { + return &GetCompaniesParams{ + HTTPClient: client, + } +} + +/* GetCompaniesParams contains all the parameters to send to the API endpoint + for the get companies operation. + + Typically these are written to a http.Request. +*/ +type GetCompaniesParams struct { + + /* CompanyID. + + Telnexus Company record ID + */ + CompanyID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get companies params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCompaniesParams) WithDefaults() *GetCompaniesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get companies params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCompaniesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get companies params +func (o *GetCompaniesParams) WithTimeout(timeout time.Duration) *GetCompaniesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get companies params +func (o *GetCompaniesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get companies params +func (o *GetCompaniesParams) WithContext(ctx context.Context) *GetCompaniesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get companies params +func (o *GetCompaniesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get companies params +func (o *GetCompaniesParams) WithHTTPClient(client *http.Client) *GetCompaniesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get companies params +func (o *GetCompaniesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCompanyID adds the companyID to the get companies params +func (o *GetCompaniesParams) WithCompanyID(companyID *string) *GetCompaniesParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get companies params +func (o *GetCompaniesParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCompaniesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CompanyID != nil { + + // query param companyId + var qrCompanyID string + + if o.CompanyID != nil { + qrCompanyID = *o.CompanyID + } + qCompanyID := qrCompanyID + if qCompanyID != "" { + + if err := r.SetQueryParam("companyId", qCompanyID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/crm/crm_client/companies/get_companies_responses.go b/api/crm/crm_client/companies/get_companies_responses.go new file mode 100644 index 0000000..d327fa3 --- /dev/null +++ b/api/crm/crm_client/companies/get_companies_responses.go @@ -0,0 +1,323 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package companies + +// 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/telnexus/lib/api/crm/crm_models" +) + +// GetCompaniesReader is a Reader for the GetCompanies structure. +type GetCompaniesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCompaniesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCompaniesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetCompaniesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetCompaniesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetCompaniesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetCompaniesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetCompaniesInternalServerError() + 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()) + } +} + +// NewGetCompaniesOK creates a GetCompaniesOK with default headers values +func NewGetCompaniesOK() *GetCompaniesOK { + return &GetCompaniesOK{} +} + +/* GetCompaniesOK describes a response with status code 200, with default header values. + +Telnexus Response with Company objects +*/ +type GetCompaniesOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *crm_models.CompanyResponse +} + +func (o *GetCompaniesOK) Error() string { + return fmt.Sprintf("[GET /companies][%d] getCompaniesOK %+v", 200, o.Payload) +} +func (o *GetCompaniesOK) GetPayload() *crm_models.CompanyResponse { + return o.Payload +} + +func (o *GetCompaniesOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(crm_models.CompanyResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCompaniesUnauthorized creates a GetCompaniesUnauthorized with default headers values +func NewGetCompaniesUnauthorized() *GetCompaniesUnauthorized { + return &GetCompaniesUnauthorized{} +} + +/* GetCompaniesUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetCompaniesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetCompaniesUnauthorized) Error() string { + return fmt.Sprintf("[GET /companies][%d] getCompaniesUnauthorized %+v", 401, o.Payload) +} +func (o *GetCompaniesUnauthorized) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetCompaniesUnauthorized) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetCompaniesForbidden creates a GetCompaniesForbidden with default headers values +func NewGetCompaniesForbidden() *GetCompaniesForbidden { + return &GetCompaniesForbidden{} +} + +/* GetCompaniesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetCompaniesForbidden struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetCompaniesForbidden) Error() string { + return fmt.Sprintf("[GET /companies][%d] getCompaniesForbidden %+v", 403, o.Payload) +} +func (o *GetCompaniesForbidden) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetCompaniesForbidden) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetCompaniesNotFound creates a GetCompaniesNotFound with default headers values +func NewGetCompaniesNotFound() *GetCompaniesNotFound { + return &GetCompaniesNotFound{} +} + +/* GetCompaniesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetCompaniesNotFound struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetCompaniesNotFound) Error() string { + return fmt.Sprintf("[GET /companies][%d] getCompaniesNotFound %+v", 404, o.Payload) +} +func (o *GetCompaniesNotFound) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetCompaniesNotFound) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetCompaniesUnprocessableEntity creates a GetCompaniesUnprocessableEntity with default headers values +func NewGetCompaniesUnprocessableEntity() *GetCompaniesUnprocessableEntity { + return &GetCompaniesUnprocessableEntity{} +} + +/* GetCompaniesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetCompaniesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetCompaniesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /companies][%d] getCompaniesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetCompaniesUnprocessableEntity) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetCompaniesUnprocessableEntity) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetCompaniesInternalServerError creates a GetCompaniesInternalServerError with default headers values +func NewGetCompaniesInternalServerError() *GetCompaniesInternalServerError { + return &GetCompaniesInternalServerError{} +} + +/* GetCompaniesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetCompaniesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetCompaniesInternalServerError) Error() string { + return fmt.Sprintf("[GET /companies][%d] getCompaniesInternalServerError %+v", 500, o.Payload) +} +func (o *GetCompaniesInternalServerError) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetCompaniesInternalServerError) 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 && err != io.EOF { + return err + } + + return nil +} diff --git a/api/crm/crm_client/companies/post_companies_parameters.go b/api/crm/crm_client/companies/post_companies_parameters.go new file mode 100644 index 0000000..7880cf3 --- /dev/null +++ b/api/crm/crm_client/companies/post_companies_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package companies + +// 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/telnexus/lib/api/crm/crm_models" +) + +// NewPostCompaniesParams creates a new PostCompaniesParams 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 NewPostCompaniesParams() *PostCompaniesParams { + return &PostCompaniesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostCompaniesParamsWithTimeout creates a new PostCompaniesParams object +// with the ability to set a timeout on a request. +func NewPostCompaniesParamsWithTimeout(timeout time.Duration) *PostCompaniesParams { + return &PostCompaniesParams{ + timeout: timeout, + } +} + +// NewPostCompaniesParamsWithContext creates a new PostCompaniesParams object +// with the ability to set a context for a request. +func NewPostCompaniesParamsWithContext(ctx context.Context) *PostCompaniesParams { + return &PostCompaniesParams{ + Context: ctx, + } +} + +// NewPostCompaniesParamsWithHTTPClient creates a new PostCompaniesParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostCompaniesParamsWithHTTPClient(client *http.Client) *PostCompaniesParams { + return &PostCompaniesParams{ + HTTPClient: client, + } +} + +/* PostCompaniesParams contains all the parameters to send to the API endpoint + for the post companies operation. + + Typically these are written to a http.Request. +*/ +type PostCompaniesParams struct { + + /* CompaniesRequest. + + An array of new Contact records + */ + CompaniesRequest *crm_models.CompanyRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post companies params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostCompaniesParams) WithDefaults() *PostCompaniesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post companies params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostCompaniesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post companies params +func (o *PostCompaniesParams) WithTimeout(timeout time.Duration) *PostCompaniesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post companies params +func (o *PostCompaniesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post companies params +func (o *PostCompaniesParams) WithContext(ctx context.Context) *PostCompaniesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post companies params +func (o *PostCompaniesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post companies params +func (o *PostCompaniesParams) WithHTTPClient(client *http.Client) *PostCompaniesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post companies params +func (o *PostCompaniesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCompaniesRequest adds the companiesRequest to the post companies params +func (o *PostCompaniesParams) WithCompaniesRequest(companiesRequest *crm_models.CompanyRequest) *PostCompaniesParams { + o.SetCompaniesRequest(companiesRequest) + return o +} + +// SetCompaniesRequest adds the companiesRequest to the post companies params +func (o *PostCompaniesParams) SetCompaniesRequest(companiesRequest *crm_models.CompanyRequest) { + o.CompaniesRequest = companiesRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostCompaniesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CompaniesRequest != nil { + if err := r.SetBodyParam(o.CompaniesRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/crm/crm_client/companies/post_companies_responses.go b/api/crm/crm_client/companies/post_companies_responses.go new file mode 100644 index 0000000..d20f1d8 --- /dev/null +++ b/api/crm/crm_client/companies/post_companies_responses.go @@ -0,0 +1,323 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package companies + +// 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/telnexus/lib/api/crm/crm_models" +) + +// PostCompaniesReader is a Reader for the PostCompanies structure. +type PostCompaniesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostCompaniesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostCompaniesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostCompaniesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostCompaniesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostCompaniesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostCompaniesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostCompaniesInternalServerError() + 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()) + } +} + +// NewPostCompaniesOK creates a PostCompaniesOK with default headers values +func NewPostCompaniesOK() *PostCompaniesOK { + return &PostCompaniesOK{} +} + +/* PostCompaniesOK describes a response with status code 200, with default header values. + +Telnexus Response with Company objects +*/ +type PostCompaniesOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *crm_models.CompanyResponse +} + +func (o *PostCompaniesOK) Error() string { + return fmt.Sprintf("[POST /companies][%d] postCompaniesOK %+v", 200, o.Payload) +} +func (o *PostCompaniesOK) GetPayload() *crm_models.CompanyResponse { + return o.Payload +} + +func (o *PostCompaniesOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(crm_models.CompanyResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCompaniesUnauthorized creates a PostCompaniesUnauthorized with default headers values +func NewPostCompaniesUnauthorized() *PostCompaniesUnauthorized { + return &PostCompaniesUnauthorized{} +} + +/* PostCompaniesUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostCompaniesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PostCompaniesUnauthorized) Error() string { + return fmt.Sprintf("[POST /companies][%d] postCompaniesUnauthorized %+v", 401, o.Payload) +} +func (o *PostCompaniesUnauthorized) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PostCompaniesUnauthorized) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPostCompaniesForbidden creates a PostCompaniesForbidden with default headers values +func NewPostCompaniesForbidden() *PostCompaniesForbidden { + return &PostCompaniesForbidden{} +} + +/* PostCompaniesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostCompaniesForbidden struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PostCompaniesForbidden) Error() string { + return fmt.Sprintf("[POST /companies][%d] postCompaniesForbidden %+v", 403, o.Payload) +} +func (o *PostCompaniesForbidden) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PostCompaniesForbidden) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPostCompaniesNotFound creates a PostCompaniesNotFound with default headers values +func NewPostCompaniesNotFound() *PostCompaniesNotFound { + return &PostCompaniesNotFound{} +} + +/* PostCompaniesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostCompaniesNotFound struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PostCompaniesNotFound) Error() string { + return fmt.Sprintf("[POST /companies][%d] postCompaniesNotFound %+v", 404, o.Payload) +} +func (o *PostCompaniesNotFound) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PostCompaniesNotFound) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPostCompaniesUnprocessableEntity creates a PostCompaniesUnprocessableEntity with default headers values +func NewPostCompaniesUnprocessableEntity() *PostCompaniesUnprocessableEntity { + return &PostCompaniesUnprocessableEntity{} +} + +/* PostCompaniesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostCompaniesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PostCompaniesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /companies][%d] postCompaniesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PostCompaniesUnprocessableEntity) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PostCompaniesUnprocessableEntity) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPostCompaniesInternalServerError creates a PostCompaniesInternalServerError with default headers values +func NewPostCompaniesInternalServerError() *PostCompaniesInternalServerError { + return &PostCompaniesInternalServerError{} +} + +/* PostCompaniesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostCompaniesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PostCompaniesInternalServerError) Error() string { + return fmt.Sprintf("[POST /companies][%d] postCompaniesInternalServerError %+v", 500, o.Payload) +} +func (o *PostCompaniesInternalServerError) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PostCompaniesInternalServerError) 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 && err != io.EOF { + return err + } + + return nil +} diff --git a/api/crm/crm_client/contacts/contacts_client.go b/api/crm/crm_client/contacts/contacts_client.go new file mode 100644 index 0000000..3d0b011 --- /dev/null +++ b/api/crm/crm_client/contacts/contacts_client.go @@ -0,0 +1,258 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new contacts API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for contacts 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 { + DeleteContact(params *DeleteContactParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteContactOK, error) + + GetContacts(params *GetContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContactsOK, error) + + GetContactsObservable(params *GetContactsObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContactsObservableOK, error) + + PostContacts(params *PostContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostContactsOK, error) + + PutContacts(params *PutContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutContactsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteContact deletes a contact + + Delete Telnexus Contact record +*/ +func (a *Client) DeleteContact(params *DeleteContactParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteContactOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteContactParams() + } + op := &runtime.ClientOperation{ + ID: "deleteContact", + Method: "DELETE", + PathPattern: "/contacts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + 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) + if err != nil { + return nil, err + } + 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 + 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 +*/ +func (a *Client) GetContacts(params *GetContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContactsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetContactsParams() + } + op := &runtime.ClientOperation{ + ID: "getContacts", + Method: "GET", + PathPattern: "/contacts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + 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) + if err != nil { + return nil, err + } + 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 + 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) +} + +/* + GetContactsObservable gets telnexus contacts in an observable array + + A list of contacts in a simple JSON array +*/ +func (a *Client) GetContactsObservable(params *GetContactsObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContactsObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetContactsObservableParams() + } + op := &runtime.ClientOperation{ + ID: "getContactsObservable", + Method: "GET", + PathPattern: "/contacts/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetContactsObservableReader{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.(*GetContactsObservableOK) + 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 getContactsObservable: 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 +*/ +func (a *Client) PostContacts(params *PostContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostContactsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostContactsParams() + } + op := &runtime.ClientOperation{ + ID: "postContacts", + Method: "POST", + PathPattern: "/contacts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + 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) + if err != nil { + return nil, err + } + 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 + 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 +*/ +func (a *Client) PutContacts(params *PutContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutContactsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutContactsParams() + } + op := &runtime.ClientOperation{ + ID: "putContacts", + Method: "PUT", + PathPattern: "/contacts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + 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) + if err != nil { + return nil, err + } + 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 + 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) { + a.transport = transport +} diff --git a/api/crm/crm_client/contacts/delete_contact_parameters.go b/api/crm/crm_client/contacts/delete_contact_parameters.go new file mode 100644 index 0000000..4648399 --- /dev/null +++ b/api/crm/crm_client/contacts/delete_contact_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteContactParams creates a new DeleteContactParams 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 NewDeleteContactParams() *DeleteContactParams { + return &DeleteContactParams{ + timeout: 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, + } +} + +// NewDeleteContactParamsWithContext creates a new DeleteContactParams object +// with the ability to set a context for a request. +func NewDeleteContactParamsWithContext(ctx context.Context) *DeleteContactParams { + return &DeleteContactParams{ + Context: ctx, + } +} + +// NewDeleteContactParamsWithHTTPClient creates a new DeleteContactParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteContactParamsWithHTTPClient(client *http.Client) *DeleteContactParams { + return &DeleteContactParams{ + HTTPClient: client, + } +} + +/* DeleteContactParams contains all the parameters to send to the API endpoint + for the delete contact operation. + + Typically these are written to a http.Request. +*/ +type DeleteContactParams struct { + + /* ContactID. + + Telnexus Contact record ID + */ + ContactID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete contact params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteContactParams) WithDefaults() *DeleteContactParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete contact params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteContactParams) SetDefaults() { + // no default values defined for this parameter +} + +// 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 +func (o *DeleteContactParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete contact params +func (o *DeleteContactParams) WithContext(ctx context.Context) *DeleteContactParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete contact params +func (o *DeleteContactParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// 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 +func (o *DeleteContactParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// 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 +func (o *DeleteContactParams) SetContactID(contactID *string) { + o.ContactID = contactID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteContactParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ContactID != nil { + + // query param contactId + var qrContactID string + + if o.ContactID != nil { + qrContactID = *o.ContactID + } + qContactID := qrContactID + if qContactID != "" { + + if err := r.SetQueryParam("contactId", qContactID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/crm/crm_client/contacts/delete_contact_responses.go b/api/crm/crm_client/contacts/delete_contact_responses.go new file mode 100644 index 0000000..1cc199b --- /dev/null +++ b/api/crm/crm_client/contacts/delete_contact_responses.go @@ -0,0 +1,315 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/crm/crm_models" +) + +// DeleteContactReader is a Reader for the DeleteContact structure. +type DeleteContactReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteContactReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteContactOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeleteContactUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteContactForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteContactNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewDeleteContactUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteContactInternalServerError() + 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()) + } +} + +// NewDeleteContactOK creates a DeleteContactOK with default headers values +func NewDeleteContactOK() *DeleteContactOK { + return &DeleteContactOK{} +} + +/* DeleteContactOK describes a response with status code 200, with default header values. + +Telnexus Response with Message Objects with Delete Status +*/ +type DeleteContactOK struct { + AccessControlAllowOrigin string + + Payload *crm_models.DeleteResponse +} + +func (o *DeleteContactOK) Error() string { + return fmt.Sprintf("[DELETE /contacts][%d] deleteContactOK %+v", 200, o.Payload) +} +func (o *DeleteContactOK) GetPayload() *crm_models.DeleteResponse { + return o.Payload +} + +func (o *DeleteContactOK) 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.DeleteResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteContactUnauthorized creates a DeleteContactUnauthorized with default headers values +func NewDeleteContactUnauthorized() *DeleteContactUnauthorized { + return &DeleteContactUnauthorized{} +} + +/* DeleteContactUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type DeleteContactUnauthorized struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *DeleteContactUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /contacts][%d] deleteContactUnauthorized %+v", 401, o.Payload) +} +func (o *DeleteContactUnauthorized) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *DeleteContactUnauthorized) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteContactForbidden creates a DeleteContactForbidden with default headers values +func NewDeleteContactForbidden() *DeleteContactForbidden { + return &DeleteContactForbidden{} +} + +/* DeleteContactForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type DeleteContactForbidden struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *DeleteContactForbidden) Error() string { + return fmt.Sprintf("[DELETE /contacts][%d] deleteContactForbidden %+v", 403, o.Payload) +} +func (o *DeleteContactForbidden) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *DeleteContactForbidden) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteContactNotFound creates a DeleteContactNotFound with default headers values +func NewDeleteContactNotFound() *DeleteContactNotFound { + return &DeleteContactNotFound{} +} + +/* DeleteContactNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type DeleteContactNotFound struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *DeleteContactNotFound) Error() string { + return fmt.Sprintf("[DELETE /contacts][%d] deleteContactNotFound %+v", 404, o.Payload) +} +func (o *DeleteContactNotFound) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *DeleteContactNotFound) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteContactUnprocessableEntity creates a DeleteContactUnprocessableEntity with default headers values +func NewDeleteContactUnprocessableEntity() *DeleteContactUnprocessableEntity { + return &DeleteContactUnprocessableEntity{} +} + +/* DeleteContactUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type DeleteContactUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *DeleteContactUnprocessableEntity) Error() string { + return fmt.Sprintf("[DELETE /contacts][%d] deleteContactUnprocessableEntity %+v", 422, o.Payload) +} +func (o *DeleteContactUnprocessableEntity) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *DeleteContactUnprocessableEntity) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteContactInternalServerError creates a DeleteContactInternalServerError with default headers values +func NewDeleteContactInternalServerError() *DeleteContactInternalServerError { + return &DeleteContactInternalServerError{} +} + +/* DeleteContactInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type DeleteContactInternalServerError struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *DeleteContactInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /contacts][%d] deleteContactInternalServerError %+v", 500, o.Payload) +} +func (o *DeleteContactInternalServerError) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *DeleteContactInternalServerError) 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 && err != io.EOF { + return err + } + + return nil +} diff --git a/api/crm/crm_client/contacts/get_contacts_observable_parameters.go b/api/crm/crm_client/contacts/get_contacts_observable_parameters.go new file mode 100644 index 0000000..56d0408 --- /dev/null +++ b/api/crm/crm_client/contacts/get_contacts_observable_parameters.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + + "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" +) + +// NewGetContactsObservableParams creates a new GetContactsObservableParams 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 NewGetContactsObservableParams() *GetContactsObservableParams { + return &GetContactsObservableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetContactsObservableParamsWithTimeout creates a new GetContactsObservableParams object +// with the ability to set a timeout on a request. +func NewGetContactsObservableParamsWithTimeout(timeout time.Duration) *GetContactsObservableParams { + return &GetContactsObservableParams{ + timeout: timeout, + } +} + +// NewGetContactsObservableParamsWithContext creates a new GetContactsObservableParams object +// with the ability to set a context for a request. +func NewGetContactsObservableParamsWithContext(ctx context.Context) *GetContactsObservableParams { + return &GetContactsObservableParams{ + Context: ctx, + } +} + +// NewGetContactsObservableParamsWithHTTPClient creates a new GetContactsObservableParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetContactsObservableParamsWithHTTPClient(client *http.Client) *GetContactsObservableParams { + return &GetContactsObservableParams{ + HTTPClient: client, + } +} + +/* GetContactsObservableParams contains all the parameters to send to the API endpoint + for the get contacts observable operation. + + Typically these are written to a http.Request. +*/ +type GetContactsObservableParams struct { + + /* Active. + + Only retrieve active records? + */ + Active *bool + + /* ContactID. + + Telnexus Contact record ID + */ + ContactID *string + + /* Email. + + Email address used for identity lookup + */ + Email *string + + /* Name. + + The Name of this Object + */ + Name *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get contacts observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetContactsObservableParams) WithDefaults() *GetContactsObservableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get contacts observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetContactsObservableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get contacts observable params +func (o *GetContactsObservableParams) WithTimeout(timeout time.Duration) *GetContactsObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get contacts observable params +func (o *GetContactsObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get contacts observable params +func (o *GetContactsObservableParams) WithContext(ctx context.Context) *GetContactsObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get contacts observable params +func (o *GetContactsObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get contacts observable params +func (o *GetContactsObservableParams) WithHTTPClient(client *http.Client) *GetContactsObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get contacts observable params +func (o *GetContactsObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithActive adds the active to the get contacts observable params +func (o *GetContactsObservableParams) WithActive(active *bool) *GetContactsObservableParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get contacts observable params +func (o *GetContactsObservableParams) SetActive(active *bool) { + o.Active = active +} + +// WithContactID adds the contactID to the get contacts observable params +func (o *GetContactsObservableParams) WithContactID(contactID *string) *GetContactsObservableParams { + o.SetContactID(contactID) + return o +} + +// SetContactID adds the contactId to the get contacts observable params +func (o *GetContactsObservableParams) SetContactID(contactID *string) { + o.ContactID = contactID +} + +// WithEmail adds the email to the get contacts observable params +func (o *GetContactsObservableParams) WithEmail(email *string) *GetContactsObservableParams { + o.SetEmail(email) + return o +} + +// SetEmail adds the email to the get contacts observable params +func (o *GetContactsObservableParams) SetEmail(email *string) { + o.Email = email +} + +// WithName adds the name to the get contacts observable params +func (o *GetContactsObservableParams) WithName(name *string) *GetContactsObservableParams { + o.SetName(name) + return o +} + +// SetName adds the name to the get contacts observable params +func (o *GetContactsObservableParams) SetName(name *string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *GetContactsObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Active != nil { + + // query param active + var qrActive bool + + if o.Active != nil { + qrActive = *o.Active + } + qActive := swag.FormatBool(qrActive) + if qActive != "" { + + if err := r.SetQueryParam("active", qActive); err != nil { + return err + } + } + } + + if o.ContactID != nil { + + // query param contactId + var qrContactID string + + if o.ContactID != nil { + qrContactID = *o.ContactID + } + qContactID := qrContactID + if qContactID != "" { + + if err := r.SetQueryParam("contactId", qContactID); err != nil { + return err + } + } + } + + if o.Email != nil { + + // query param email + var qrEmail string + + if o.Email != nil { + qrEmail = *o.Email + } + qEmail := qrEmail + if qEmail != "" { + + if err := r.SetQueryParam("email", qEmail); err != nil { + return err + } + } + } + + if o.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/crm/crm_client/contacts/get_contacts_observable_responses.go b/api/crm/crm_client/contacts/get_contacts_observable_responses.go new file mode 100644 index 0000000..973c68e --- /dev/null +++ b/api/crm/crm_client/contacts/get_contacts_observable_responses.go @@ -0,0 +1,321 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/crm/crm_models" +) + +// GetContactsObservableReader is a Reader for the GetContactsObservable structure. +type GetContactsObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetContactsObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetContactsObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetContactsObservableUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetContactsObservableForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetContactsObservableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetContactsObservableUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetContactsObservableInternalServerError() + 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()) + } +} + +// NewGetContactsObservableOK creates a GetContactsObservableOK with default headers values +func NewGetContactsObservableOK() *GetContactsObservableOK { + return &GetContactsObservableOK{} +} + +/* GetContactsObservableOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of Contact objects +*/ +type GetContactsObservableOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload []*crm_models.Contact +} + +func (o *GetContactsObservableOK) Error() string { + return fmt.Sprintf("[GET /contacts/observable][%d] getContactsObservableOK %+v", 200, o.Payload) +} +func (o *GetContactsObservableOK) GetPayload() []*crm_models.Contact { + return o.Payload +} + +func (o *GetContactsObservableOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetContactsObservableUnauthorized creates a GetContactsObservableUnauthorized with default headers values +func NewGetContactsObservableUnauthorized() *GetContactsObservableUnauthorized { + return &GetContactsObservableUnauthorized{} +} + +/* GetContactsObservableUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetContactsObservableUnauthorized struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetContactsObservableUnauthorized) Error() string { + return fmt.Sprintf("[GET /contacts/observable][%d] getContactsObservableUnauthorized %+v", 401, o.Payload) +} +func (o *GetContactsObservableUnauthorized) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetContactsObservableUnauthorized) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetContactsObservableForbidden creates a GetContactsObservableForbidden with default headers values +func NewGetContactsObservableForbidden() *GetContactsObservableForbidden { + return &GetContactsObservableForbidden{} +} + +/* GetContactsObservableForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetContactsObservableForbidden struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetContactsObservableForbidden) Error() string { + return fmt.Sprintf("[GET /contacts/observable][%d] getContactsObservableForbidden %+v", 403, o.Payload) +} +func (o *GetContactsObservableForbidden) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetContactsObservableForbidden) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetContactsObservableNotFound creates a GetContactsObservableNotFound with default headers values +func NewGetContactsObservableNotFound() *GetContactsObservableNotFound { + return &GetContactsObservableNotFound{} +} + +/* GetContactsObservableNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetContactsObservableNotFound struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetContactsObservableNotFound) Error() string { + return fmt.Sprintf("[GET /contacts/observable][%d] getContactsObservableNotFound %+v", 404, o.Payload) +} +func (o *GetContactsObservableNotFound) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetContactsObservableNotFound) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetContactsObservableUnprocessableEntity creates a GetContactsObservableUnprocessableEntity with default headers values +func NewGetContactsObservableUnprocessableEntity() *GetContactsObservableUnprocessableEntity { + return &GetContactsObservableUnprocessableEntity{} +} + +/* GetContactsObservableUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetContactsObservableUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetContactsObservableUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /contacts/observable][%d] getContactsObservableUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetContactsObservableUnprocessableEntity) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetContactsObservableUnprocessableEntity) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetContactsObservableInternalServerError creates a GetContactsObservableInternalServerError with default headers values +func NewGetContactsObservableInternalServerError() *GetContactsObservableInternalServerError { + return &GetContactsObservableInternalServerError{} +} + +/* GetContactsObservableInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetContactsObservableInternalServerError struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetContactsObservableInternalServerError) Error() string { + return fmt.Sprintf("[GET /contacts/observable][%d] getContactsObservableInternalServerError %+v", 500, o.Payload) +} +func (o *GetContactsObservableInternalServerError) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetContactsObservableInternalServerError) 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 && err != io.EOF { + return err + } + + return nil +} diff --git a/api/crm/crm_client/contacts/get_contacts_parameters.go b/api/crm/crm_client/contacts/get_contacts_parameters.go new file mode 100644 index 0000000..19b41a6 --- /dev/null +++ b/api/crm/crm_client/contacts/get_contacts_parameters.go @@ -0,0 +1,340 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + + "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" +) + +// NewGetContactsParams creates a new GetContactsParams 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 NewGetContactsParams() *GetContactsParams { + return &GetContactsParams{ + timeout: 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, + } +} + +// NewGetContactsParamsWithContext creates a new GetContactsParams object +// with the ability to set a context for a request. +func NewGetContactsParamsWithContext(ctx context.Context) *GetContactsParams { + return &GetContactsParams{ + Context: ctx, + } +} + +// NewGetContactsParamsWithHTTPClient creates a new GetContactsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetContactsParamsWithHTTPClient(client *http.Client) *GetContactsParams { + return &GetContactsParams{ + HTTPClient: client, + } +} + +/* GetContactsParams contains all the parameters to send to the API endpoint + for the get contacts operation. + + Typically these are written to a http.Request. +*/ +type GetContactsParams struct { + + /* Active. + + Only retrieve active records? + */ + Active *bool + + /* ContactID. + + Telnexus Contact record ID + */ + ContactID *string + + /* Email. + + Email address used for identity lookup + */ + Email *string + + /* Limit. + + How many objects to return at one time + + Format: int64 + */ + Limit *int64 + + /* Name. + + The Name of this Object + */ + Name *string + + /* 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 contacts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetContactsParams) WithDefaults() *GetContactsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get contacts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetContactsParams) SetDefaults() { + // no default values defined for this parameter +} + +// 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 +func (o *GetContactsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get contacts params +func (o *GetContactsParams) WithContext(ctx context.Context) *GetContactsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get contacts params +func (o *GetContactsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// 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 +func (o *GetContactsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// 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 +func (o *GetContactsParams) SetActive(active *bool) { + o.Active = active +} + +// 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 +func (o *GetContactsParams) SetContactID(contactID *string) { + o.ContactID = contactID +} + +// 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 +func (o *GetContactsParams) SetEmail(email *string) { + o.Email = email +} + +// 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 +func (o *GetContactsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the get contacts params +func (o *GetContactsParams) WithName(name *string) *GetContactsParams { + o.SetName(name) + return o +} + +// SetName adds the name to the get contacts params +func (o *GetContactsParams) SetName(name *string) { + o.Name = name +} + +// 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 +func (o *GetContactsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetContactsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Active != nil { + + // query param active + var qrActive bool + + if o.Active != nil { + qrActive = *o.Active + } + qActive := swag.FormatBool(qrActive) + if qActive != "" { + + if err := r.SetQueryParam("active", qActive); err != nil { + return err + } + } + } + + if o.ContactID != nil { + + // query param contactId + var qrContactID string + + if o.ContactID != nil { + qrContactID = *o.ContactID + } + qContactID := qrContactID + if qContactID != "" { + + if err := r.SetQueryParam("contactId", qContactID); err != nil { + return err + } + } + } + + if o.Email != nil { + + // query param email + var qrEmail string + + if o.Email != nil { + qrEmail = *o.Email + } + qEmail := qrEmail + if qEmail != "" { + + if err := r.SetQueryParam("email", qEmail); 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.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); 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 +} diff --git a/api/crm/crm_client/contacts/get_contacts_responses.go b/api/crm/crm_client/contacts/get_contacts_responses.go new file mode 100644 index 0000000..2c09534 --- /dev/null +++ b/api/crm/crm_client/contacts/get_contacts_responses.go @@ -0,0 +1,323 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/crm/crm_models" +) + +// GetContactsReader is a Reader for the GetContacts structure. +type GetContactsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetContactsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetContactsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetContactsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetContactsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetContactsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetContactsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetContactsInternalServerError() + 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()) + } +} + +// NewGetContactsOK creates a GetContactsOK with default headers values +func NewGetContactsOK() *GetContactsOK { + return &GetContactsOK{} +} + +/* GetContactsOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of Contact objects +*/ +type GetContactsOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *crm_models.ContactResponse +} + +func (o *GetContactsOK) Error() string { + return fmt.Sprintf("[GET /contacts][%d] getContactsOK %+v", 200, o.Payload) +} +func (o *GetContactsOK) GetPayload() *crm_models.ContactResponse { + return o.Payload +} + +func (o *GetContactsOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(crm_models.ContactResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetContactsUnauthorized creates a GetContactsUnauthorized with default headers values +func NewGetContactsUnauthorized() *GetContactsUnauthorized { + return &GetContactsUnauthorized{} +} + +/* GetContactsUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetContactsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetContactsUnauthorized) Error() string { + return fmt.Sprintf("[GET /contacts][%d] getContactsUnauthorized %+v", 401, o.Payload) +} +func (o *GetContactsUnauthorized) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetContactsUnauthorized) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetContactsForbidden creates a GetContactsForbidden with default headers values +func NewGetContactsForbidden() *GetContactsForbidden { + return &GetContactsForbidden{} +} + +/* GetContactsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetContactsForbidden struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetContactsForbidden) Error() string { + return fmt.Sprintf("[GET /contacts][%d] getContactsForbidden %+v", 403, o.Payload) +} +func (o *GetContactsForbidden) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetContactsForbidden) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetContactsNotFound creates a GetContactsNotFound with default headers values +func NewGetContactsNotFound() *GetContactsNotFound { + return &GetContactsNotFound{} +} + +/* GetContactsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetContactsNotFound struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetContactsNotFound) Error() string { + return fmt.Sprintf("[GET /contacts][%d] getContactsNotFound %+v", 404, o.Payload) +} +func (o *GetContactsNotFound) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetContactsNotFound) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetContactsUnprocessableEntity creates a GetContactsUnprocessableEntity with default headers values +func NewGetContactsUnprocessableEntity() *GetContactsUnprocessableEntity { + return &GetContactsUnprocessableEntity{} +} + +/* GetContactsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetContactsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetContactsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /contacts][%d] getContactsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetContactsUnprocessableEntity) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetContactsUnprocessableEntity) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetContactsInternalServerError creates a GetContactsInternalServerError with default headers values +func NewGetContactsInternalServerError() *GetContactsInternalServerError { + return &GetContactsInternalServerError{} +} + +/* GetContactsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetContactsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetContactsInternalServerError) Error() string { + return fmt.Sprintf("[GET /contacts][%d] getContactsInternalServerError %+v", 500, o.Payload) +} +func (o *GetContactsInternalServerError) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetContactsInternalServerError) 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 && err != io.EOF { + return err + } + + return nil +} diff --git a/api/crm/crm_client/contacts/post_contacts_parameters.go b/api/crm/crm_client/contacts/post_contacts_parameters.go new file mode 100644 index 0000000..b358747 --- /dev/null +++ b/api/crm/crm_client/contacts/post_contacts_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + + "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/telnexus/lib/api/crm/crm_models" +) + +// NewPostContactsParams creates a new PostContactsParams 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 NewPostContactsParams() *PostContactsParams { + return &PostContactsParams{ + timeout: 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, + } +} + +// NewPostContactsParamsWithContext creates a new PostContactsParams object +// with the ability to set a context for a request. +func NewPostContactsParamsWithContext(ctx context.Context) *PostContactsParams { + return &PostContactsParams{ + Context: ctx, + } +} + +// NewPostContactsParamsWithHTTPClient creates a new PostContactsParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostContactsParamsWithHTTPClient(client *http.Client) *PostContactsParams { + return &PostContactsParams{ + HTTPClient: client, + } +} + +/* PostContactsParams contains all the parameters to send to the API endpoint + for the post contacts operation. + + Typically these are written to a http.Request. +*/ +type PostContactsParams struct { + + /* ContactsRequest. + + An array of new Contact records + */ + ContactsRequest *crm_models.ContactRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post contacts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostContactsParams) WithDefaults() *PostContactsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post contacts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostContactsParams) SetDefaults() { + // no default values defined for this parameter +} + +// 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 +func (o *PostContactsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post contacts params +func (o *PostContactsParams) WithContext(ctx context.Context) *PostContactsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post contacts params +func (o *PostContactsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// 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 +func (o *PostContactsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// 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 +func (o *PostContactsParams) SetContactsRequest(contactsRequest *crm_models.ContactRequest) { + o.ContactsRequest = contactsRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostContactsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.ContactsRequest != nil { + if err := r.SetBodyParam(o.ContactsRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/crm/crm_client/contacts/post_contacts_responses.go b/api/crm/crm_client/contacts/post_contacts_responses.go new file mode 100644 index 0000000..8f9a9d9 --- /dev/null +++ b/api/crm/crm_client/contacts/post_contacts_responses.go @@ -0,0 +1,323 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/crm/crm_models" +) + +// PostContactsReader is a Reader for the PostContacts structure. +type PostContactsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostContactsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostContactsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostContactsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostContactsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostContactsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostContactsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostContactsInternalServerError() + 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()) + } +} + +// NewPostContactsOK creates a PostContactsOK with default headers values +func NewPostContactsOK() *PostContactsOK { + return &PostContactsOK{} +} + +/* PostContactsOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of Contact objects +*/ +type PostContactsOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *crm_models.ContactResponse +} + +func (o *PostContactsOK) Error() string { + return fmt.Sprintf("[POST /contacts][%d] postContactsOK %+v", 200, o.Payload) +} +func (o *PostContactsOK) GetPayload() *crm_models.ContactResponse { + return o.Payload +} + +func (o *PostContactsOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(crm_models.ContactResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostContactsUnauthorized creates a PostContactsUnauthorized with default headers values +func NewPostContactsUnauthorized() *PostContactsUnauthorized { + return &PostContactsUnauthorized{} +} + +/* PostContactsUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostContactsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PostContactsUnauthorized) Error() string { + return fmt.Sprintf("[POST /contacts][%d] postContactsUnauthorized %+v", 401, o.Payload) +} +func (o *PostContactsUnauthorized) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PostContactsUnauthorized) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPostContactsForbidden creates a PostContactsForbidden with default headers values +func NewPostContactsForbidden() *PostContactsForbidden { + return &PostContactsForbidden{} +} + +/* PostContactsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostContactsForbidden struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PostContactsForbidden) Error() string { + return fmt.Sprintf("[POST /contacts][%d] postContactsForbidden %+v", 403, o.Payload) +} +func (o *PostContactsForbidden) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PostContactsForbidden) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPostContactsNotFound creates a PostContactsNotFound with default headers values +func NewPostContactsNotFound() *PostContactsNotFound { + return &PostContactsNotFound{} +} + +/* PostContactsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostContactsNotFound struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PostContactsNotFound) Error() string { + return fmt.Sprintf("[POST /contacts][%d] postContactsNotFound %+v", 404, o.Payload) +} +func (o *PostContactsNotFound) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PostContactsNotFound) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPostContactsUnprocessableEntity creates a PostContactsUnprocessableEntity with default headers values +func NewPostContactsUnprocessableEntity() *PostContactsUnprocessableEntity { + return &PostContactsUnprocessableEntity{} +} + +/* PostContactsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostContactsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PostContactsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /contacts][%d] postContactsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PostContactsUnprocessableEntity) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PostContactsUnprocessableEntity) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPostContactsInternalServerError creates a PostContactsInternalServerError with default headers values +func NewPostContactsInternalServerError() *PostContactsInternalServerError { + return &PostContactsInternalServerError{} +} + +/* PostContactsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostContactsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PostContactsInternalServerError) Error() string { + return fmt.Sprintf("[POST /contacts][%d] postContactsInternalServerError %+v", 500, o.Payload) +} +func (o *PostContactsInternalServerError) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PostContactsInternalServerError) 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 && err != io.EOF { + return err + } + + return nil +} diff --git a/api/crm/crm_client/contacts/put_contacts_parameters.go b/api/crm/crm_client/contacts/put_contacts_parameters.go new file mode 100644 index 0000000..0118379 --- /dev/null +++ b/api/crm/crm_client/contacts/put_contacts_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + + "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/telnexus/lib/api/crm/crm_models" +) + +// NewPutContactsParams creates a new PutContactsParams 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 NewPutContactsParams() *PutContactsParams { + return &PutContactsParams{ + timeout: 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, + } +} + +// NewPutContactsParamsWithContext creates a new PutContactsParams object +// with the ability to set a context for a request. +func NewPutContactsParamsWithContext(ctx context.Context) *PutContactsParams { + return &PutContactsParams{ + Context: ctx, + } +} + +// NewPutContactsParamsWithHTTPClient creates a new PutContactsParams object +// with the ability to set a custom HTTPClient for a request. +func NewPutContactsParamsWithHTTPClient(client *http.Client) *PutContactsParams { + return &PutContactsParams{ + HTTPClient: client, + } +} + +/* PutContactsParams contains all the parameters to send to the API endpoint + for the put contacts operation. + + Typically these are written to a http.Request. +*/ +type PutContactsParams struct { + + /* ContactsRequest. + + An array of new Contact records + */ + ContactsRequest *crm_models.ContactRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put contacts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutContactsParams) WithDefaults() *PutContactsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put contacts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutContactsParams) SetDefaults() { + // no default values defined for this parameter +} + +// 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 +func (o *PutContactsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put contacts params +func (o *PutContactsParams) WithContext(ctx context.Context) *PutContactsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put contacts params +func (o *PutContactsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// 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 +func (o *PutContactsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// 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 +func (o *PutContactsParams) SetContactsRequest(contactsRequest *crm_models.ContactRequest) { + o.ContactsRequest = contactsRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutContactsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.ContactsRequest != nil { + if err := r.SetBodyParam(o.ContactsRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/crm/crm_client/contacts/put_contacts_responses.go b/api/crm/crm_client/contacts/put_contacts_responses.go new file mode 100644 index 0000000..1885f02 --- /dev/null +++ b/api/crm/crm_client/contacts/put_contacts_responses.go @@ -0,0 +1,323 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/crm/crm_models" +) + +// PutContactsReader is a Reader for the PutContacts structure. +type PutContactsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutContactsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutContactsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutContactsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutContactsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutContactsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutContactsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutContactsInternalServerError() + 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()) + } +} + +// NewPutContactsOK creates a PutContactsOK with default headers values +func NewPutContactsOK() *PutContactsOK { + return &PutContactsOK{} +} + +/* PutContactsOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of Contact objects +*/ +type PutContactsOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *crm_models.ContactResponse +} + +func (o *PutContactsOK) Error() string { + return fmt.Sprintf("[PUT /contacts][%d] putContactsOK %+v", 200, o.Payload) +} +func (o *PutContactsOK) GetPayload() *crm_models.ContactResponse { + return o.Payload +} + +func (o *PutContactsOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(crm_models.ContactResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutContactsUnauthorized creates a PutContactsUnauthorized with default headers values +func NewPutContactsUnauthorized() *PutContactsUnauthorized { + return &PutContactsUnauthorized{} +} + +/* PutContactsUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutContactsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PutContactsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /contacts][%d] putContactsUnauthorized %+v", 401, o.Payload) +} +func (o *PutContactsUnauthorized) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PutContactsUnauthorized) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPutContactsForbidden creates a PutContactsForbidden with default headers values +func NewPutContactsForbidden() *PutContactsForbidden { + return &PutContactsForbidden{} +} + +/* PutContactsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PutContactsForbidden struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PutContactsForbidden) Error() string { + return fmt.Sprintf("[PUT /contacts][%d] putContactsForbidden %+v", 403, o.Payload) +} +func (o *PutContactsForbidden) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PutContactsForbidden) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPutContactsNotFound creates a PutContactsNotFound with default headers values +func NewPutContactsNotFound() *PutContactsNotFound { + return &PutContactsNotFound{} +} + +/* PutContactsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PutContactsNotFound struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PutContactsNotFound) Error() string { + return fmt.Sprintf("[PUT /contacts][%d] putContactsNotFound %+v", 404, o.Payload) +} +func (o *PutContactsNotFound) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PutContactsNotFound) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPutContactsUnprocessableEntity creates a PutContactsUnprocessableEntity with default headers values +func NewPutContactsUnprocessableEntity() *PutContactsUnprocessableEntity { + return &PutContactsUnprocessableEntity{} +} + +/* PutContactsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutContactsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PutContactsUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /contacts][%d] putContactsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PutContactsUnprocessableEntity) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PutContactsUnprocessableEntity) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPutContactsInternalServerError creates a PutContactsInternalServerError with default headers values +func NewPutContactsInternalServerError() *PutContactsInternalServerError { + return &PutContactsInternalServerError{} +} + +/* PutContactsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PutContactsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PutContactsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /contacts][%d] putContactsInternalServerError %+v", 500, o.Payload) +} +func (o *PutContactsInternalServerError) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PutContactsInternalServerError) 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 && err != io.EOF { + return err + } + + return nil +} diff --git a/api/crm/crm_client/cors/account_options_observable_parameters.go b/api/crm/crm_client/cors/account_options_observable_parameters.go new file mode 100644 index 0000000..1b1cbe9 --- /dev/null +++ b/api/crm/crm_client/cors/account_options_observable_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewAccountOptionsObservableParams creates a new AccountOptionsObservableParams 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 NewAccountOptionsObservableParams() *AccountOptionsObservableParams { + return &AccountOptionsObservableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewAccountOptionsObservableParamsWithTimeout creates a new AccountOptionsObservableParams object +// with the ability to set a timeout on a request. +func NewAccountOptionsObservableParamsWithTimeout(timeout time.Duration) *AccountOptionsObservableParams { + return &AccountOptionsObservableParams{ + timeout: timeout, + } +} + +// NewAccountOptionsObservableParamsWithContext creates a new AccountOptionsObservableParams object +// with the ability to set a context for a request. +func NewAccountOptionsObservableParamsWithContext(ctx context.Context) *AccountOptionsObservableParams { + return &AccountOptionsObservableParams{ + Context: ctx, + } +} + +// NewAccountOptionsObservableParamsWithHTTPClient creates a new AccountOptionsObservableParams object +// with the ability to set a custom HTTPClient for a request. +func NewAccountOptionsObservableParamsWithHTTPClient(client *http.Client) *AccountOptionsObservableParams { + return &AccountOptionsObservableParams{ + HTTPClient: client, + } +} + +/* AccountOptionsObservableParams contains all the parameters to send to the API endpoint + for the account options observable operation. + + Typically these are written to a http.Request. +*/ +type AccountOptionsObservableParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the account options observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AccountOptionsObservableParams) WithDefaults() *AccountOptionsObservableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the account options observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AccountOptionsObservableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the account options observable params +func (o *AccountOptionsObservableParams) WithTimeout(timeout time.Duration) *AccountOptionsObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the account options observable params +func (o *AccountOptionsObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the account options observable params +func (o *AccountOptionsObservableParams) WithContext(ctx context.Context) *AccountOptionsObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the account options observable params +func (o *AccountOptionsObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the account options observable params +func (o *AccountOptionsObservableParams) WithHTTPClient(client *http.Client) *AccountOptionsObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the account options observable params +func (o *AccountOptionsObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *AccountOptionsObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/crm/crm_client/cors/account_options_observable_responses.go b/api/crm/crm_client/cors/account_options_observable_responses.go new file mode 100644 index 0000000..b3edd58 --- /dev/null +++ b/api/crm/crm_client/cors/account_options_observable_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// AccountOptionsObservableReader is a Reader for the AccountOptionsObservable structure. +type AccountOptionsObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AccountOptionsObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewAccountOptionsObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewAccountOptionsObservableOK creates a AccountOptionsObservableOK with default headers values +func NewAccountOptionsObservableOK() *AccountOptionsObservableOK { + return &AccountOptionsObservableOK{} +} + +/* AccountOptionsObservableOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type AccountOptionsObservableOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *AccountOptionsObservableOK) Error() string { + return fmt.Sprintf("[OPTIONS /accounts/observable][%d] accountOptionsObservableOK ", 200) +} + +func (o *AccountOptionsObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/crm/crm_client/cors/account_options_parameters.go b/api/crm/crm_client/cors/account_options_parameters.go new file mode 100644 index 0000000..435c1b6 --- /dev/null +++ b/api/crm/crm_client/cors/account_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewAccountOptionsParams creates a new AccountOptionsParams 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 NewAccountOptionsParams() *AccountOptionsParams { + return &AccountOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewAccountOptionsParamsWithTimeout creates a new AccountOptionsParams object +// with the ability to set a timeout on a request. +func NewAccountOptionsParamsWithTimeout(timeout time.Duration) *AccountOptionsParams { + return &AccountOptionsParams{ + timeout: timeout, + } +} + +// NewAccountOptionsParamsWithContext creates a new AccountOptionsParams object +// with the ability to set a context for a request. +func NewAccountOptionsParamsWithContext(ctx context.Context) *AccountOptionsParams { + return &AccountOptionsParams{ + Context: ctx, + } +} + +// NewAccountOptionsParamsWithHTTPClient creates a new AccountOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewAccountOptionsParamsWithHTTPClient(client *http.Client) *AccountOptionsParams { + return &AccountOptionsParams{ + HTTPClient: client, + } +} + +/* AccountOptionsParams contains all the parameters to send to the API endpoint + for the account options operation. + + Typically these are written to a http.Request. +*/ +type AccountOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the account options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AccountOptionsParams) WithDefaults() *AccountOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the account options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AccountOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the account options params +func (o *AccountOptionsParams) WithTimeout(timeout time.Duration) *AccountOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the account options params +func (o *AccountOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the account options params +func (o *AccountOptionsParams) WithContext(ctx context.Context) *AccountOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the account options params +func (o *AccountOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the account options params +func (o *AccountOptionsParams) WithHTTPClient(client *http.Client) *AccountOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the account options params +func (o *AccountOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *AccountOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/crm/crm_client/cors/account_options_responses.go b/api/crm/crm_client/cors/account_options_responses.go new file mode 100644 index 0000000..9c6bc13 --- /dev/null +++ b/api/crm/crm_client/cors/account_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// AccountOptionsReader is a Reader for the AccountOptions structure. +type AccountOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AccountOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewAccountOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewAccountOptionsOK creates a AccountOptionsOK with default headers values +func NewAccountOptionsOK() *AccountOptionsOK { + return &AccountOptionsOK{} +} + +/* AccountOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type AccountOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *AccountOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /accounts][%d] accountOptionsOK ", 200) +} + +func (o *AccountOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/crm/crm_client/cors/company_observable_options_parameters.go b/api/crm/crm_client/cors/company_observable_options_parameters.go new file mode 100644 index 0000000..8b76a65 --- /dev/null +++ b/api/crm/crm_client/cors/company_observable_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewCompanyObservableOptionsParams creates a new CompanyObservableOptionsParams 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 NewCompanyObservableOptionsParams() *CompanyObservableOptionsParams { + return &CompanyObservableOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCompanyObservableOptionsParamsWithTimeout creates a new CompanyObservableOptionsParams object +// with the ability to set a timeout on a request. +func NewCompanyObservableOptionsParamsWithTimeout(timeout time.Duration) *CompanyObservableOptionsParams { + return &CompanyObservableOptionsParams{ + timeout: timeout, + } +} + +// NewCompanyObservableOptionsParamsWithContext creates a new CompanyObservableOptionsParams object +// with the ability to set a context for a request. +func NewCompanyObservableOptionsParamsWithContext(ctx context.Context) *CompanyObservableOptionsParams { + return &CompanyObservableOptionsParams{ + Context: ctx, + } +} + +// NewCompanyObservableOptionsParamsWithHTTPClient creates a new CompanyObservableOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewCompanyObservableOptionsParamsWithHTTPClient(client *http.Client) *CompanyObservableOptionsParams { + return &CompanyObservableOptionsParams{ + HTTPClient: client, + } +} + +/* CompanyObservableOptionsParams contains all the parameters to send to the API endpoint + for the company observable options operation. + + Typically these are written to a http.Request. +*/ +type CompanyObservableOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the company observable options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CompanyObservableOptionsParams) WithDefaults() *CompanyObservableOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the company observable options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CompanyObservableOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the company observable options params +func (o *CompanyObservableOptionsParams) WithTimeout(timeout time.Duration) *CompanyObservableOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the company observable options params +func (o *CompanyObservableOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the company observable options params +func (o *CompanyObservableOptionsParams) WithContext(ctx context.Context) *CompanyObservableOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the company observable options params +func (o *CompanyObservableOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the company observable options params +func (o *CompanyObservableOptionsParams) WithHTTPClient(client *http.Client) *CompanyObservableOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the company observable options params +func (o *CompanyObservableOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CompanyObservableOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/crm/crm_client/cors/company_observable_options_responses.go b/api/crm/crm_client/cors/company_observable_options_responses.go new file mode 100644 index 0000000..9d8a91c --- /dev/null +++ b/api/crm/crm_client/cors/company_observable_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// CompanyObservableOptionsReader is a Reader for the CompanyObservableOptions structure. +type CompanyObservableOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CompanyObservableOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCompanyObservableOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewCompanyObservableOptionsOK creates a CompanyObservableOptionsOK with default headers values +func NewCompanyObservableOptionsOK() *CompanyObservableOptionsOK { + return &CompanyObservableOptionsOK{} +} + +/* CompanyObservableOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type CompanyObservableOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *CompanyObservableOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /companies/observable][%d] companyObservableOptionsOK ", 200) +} + +func (o *CompanyObservableOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/crm/crm_client/cors/company_options_parameters.go b/api/crm/crm_client/cors/company_options_parameters.go new file mode 100644 index 0000000..79b54cb --- /dev/null +++ b/api/crm/crm_client/cors/company_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewCompanyOptionsParams creates a new CompanyOptionsParams 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 NewCompanyOptionsParams() *CompanyOptionsParams { + return &CompanyOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCompanyOptionsParamsWithTimeout creates a new CompanyOptionsParams object +// with the ability to set a timeout on a request. +func NewCompanyOptionsParamsWithTimeout(timeout time.Duration) *CompanyOptionsParams { + return &CompanyOptionsParams{ + timeout: timeout, + } +} + +// NewCompanyOptionsParamsWithContext creates a new CompanyOptionsParams object +// with the ability to set a context for a request. +func NewCompanyOptionsParamsWithContext(ctx context.Context) *CompanyOptionsParams { + return &CompanyOptionsParams{ + Context: ctx, + } +} + +// NewCompanyOptionsParamsWithHTTPClient creates a new CompanyOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewCompanyOptionsParamsWithHTTPClient(client *http.Client) *CompanyOptionsParams { + return &CompanyOptionsParams{ + HTTPClient: client, + } +} + +/* CompanyOptionsParams contains all the parameters to send to the API endpoint + for the company options operation. + + Typically these are written to a http.Request. +*/ +type CompanyOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the company options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CompanyOptionsParams) WithDefaults() *CompanyOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the company options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CompanyOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the company options params +func (o *CompanyOptionsParams) WithTimeout(timeout time.Duration) *CompanyOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the company options params +func (o *CompanyOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the company options params +func (o *CompanyOptionsParams) WithContext(ctx context.Context) *CompanyOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the company options params +func (o *CompanyOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the company options params +func (o *CompanyOptionsParams) WithHTTPClient(client *http.Client) *CompanyOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the company options params +func (o *CompanyOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CompanyOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/crm/crm_client/cors/company_options_responses.go b/api/crm/crm_client/cors/company_options_responses.go new file mode 100644 index 0000000..40be5c9 --- /dev/null +++ b/api/crm/crm_client/cors/company_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// CompanyOptionsReader is a Reader for the CompanyOptions structure. +type CompanyOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CompanyOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCompanyOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewCompanyOptionsOK creates a CompanyOptionsOK with default headers values +func NewCompanyOptionsOK() *CompanyOptionsOK { + return &CompanyOptionsOK{} +} + +/* CompanyOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type CompanyOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *CompanyOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /companies][%d] companyOptionsOK ", 200) +} + +func (o *CompanyOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/crm/crm_client/cors/contact_options_observable_parameters.go b/api/crm/crm_client/cors/contact_options_observable_parameters.go new file mode 100644 index 0000000..4fe0eae --- /dev/null +++ b/api/crm/crm_client/cors/contact_options_observable_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewContactOptionsObservableParams creates a new ContactOptionsObservableParams 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 NewContactOptionsObservableParams() *ContactOptionsObservableParams { + return &ContactOptionsObservableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewContactOptionsObservableParamsWithTimeout creates a new ContactOptionsObservableParams object +// with the ability to set a timeout on a request. +func NewContactOptionsObservableParamsWithTimeout(timeout time.Duration) *ContactOptionsObservableParams { + return &ContactOptionsObservableParams{ + timeout: timeout, + } +} + +// NewContactOptionsObservableParamsWithContext creates a new ContactOptionsObservableParams object +// with the ability to set a context for a request. +func NewContactOptionsObservableParamsWithContext(ctx context.Context) *ContactOptionsObservableParams { + return &ContactOptionsObservableParams{ + Context: ctx, + } +} + +// NewContactOptionsObservableParamsWithHTTPClient creates a new ContactOptionsObservableParams object +// with the ability to set a custom HTTPClient for a request. +func NewContactOptionsObservableParamsWithHTTPClient(client *http.Client) *ContactOptionsObservableParams { + return &ContactOptionsObservableParams{ + HTTPClient: client, + } +} + +/* ContactOptionsObservableParams contains all the parameters to send to the API endpoint + for the contact options observable operation. + + Typically these are written to a http.Request. +*/ +type ContactOptionsObservableParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the contact options observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ContactOptionsObservableParams) WithDefaults() *ContactOptionsObservableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the contact options observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ContactOptionsObservableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the contact options observable params +func (o *ContactOptionsObservableParams) WithTimeout(timeout time.Duration) *ContactOptionsObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the contact options observable params +func (o *ContactOptionsObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the contact options observable params +func (o *ContactOptionsObservableParams) WithContext(ctx context.Context) *ContactOptionsObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the contact options observable params +func (o *ContactOptionsObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the contact options observable params +func (o *ContactOptionsObservableParams) WithHTTPClient(client *http.Client) *ContactOptionsObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the contact options observable params +func (o *ContactOptionsObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ContactOptionsObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/crm/crm_client/cors/contact_options_observable_responses.go b/api/crm/crm_client/cors/contact_options_observable_responses.go new file mode 100644 index 0000000..40349bc --- /dev/null +++ b/api/crm/crm_client/cors/contact_options_observable_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// ContactOptionsObservableReader is a Reader for the ContactOptionsObservable structure. +type ContactOptionsObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ContactOptionsObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewContactOptionsObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewContactOptionsObservableOK creates a ContactOptionsObservableOK with default headers values +func NewContactOptionsObservableOK() *ContactOptionsObservableOK { + return &ContactOptionsObservableOK{} +} + +/* ContactOptionsObservableOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type ContactOptionsObservableOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *ContactOptionsObservableOK) Error() string { + return fmt.Sprintf("[OPTIONS /contacts/observable][%d] contactOptionsObservableOK ", 200) +} + +func (o *ContactOptionsObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/crm/crm_client/cors/contact_options_parameters.go b/api/crm/crm_client/cors/contact_options_parameters.go new file mode 100644 index 0000000..c74f6b7 --- /dev/null +++ b/api/crm/crm_client/cors/contact_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewContactOptionsParams creates a new ContactOptionsParams 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 NewContactOptionsParams() *ContactOptionsParams { + return &ContactOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewContactOptionsParamsWithTimeout creates a new ContactOptionsParams object +// with the ability to set a timeout on a request. +func NewContactOptionsParamsWithTimeout(timeout time.Duration) *ContactOptionsParams { + return &ContactOptionsParams{ + timeout: timeout, + } +} + +// NewContactOptionsParamsWithContext creates a new ContactOptionsParams object +// with the ability to set a context for a request. +func NewContactOptionsParamsWithContext(ctx context.Context) *ContactOptionsParams { + return &ContactOptionsParams{ + Context: ctx, + } +} + +// NewContactOptionsParamsWithHTTPClient creates a new ContactOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewContactOptionsParamsWithHTTPClient(client *http.Client) *ContactOptionsParams { + return &ContactOptionsParams{ + HTTPClient: client, + } +} + +/* ContactOptionsParams contains all the parameters to send to the API endpoint + for the contact options operation. + + Typically these are written to a http.Request. +*/ +type ContactOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the contact options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ContactOptionsParams) WithDefaults() *ContactOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the contact options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ContactOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the contact options params +func (o *ContactOptionsParams) WithTimeout(timeout time.Duration) *ContactOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the contact options params +func (o *ContactOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the contact options params +func (o *ContactOptionsParams) WithContext(ctx context.Context) *ContactOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the contact options params +func (o *ContactOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the contact options params +func (o *ContactOptionsParams) WithHTTPClient(client *http.Client) *ContactOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the contact options params +func (o *ContactOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ContactOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/crm/crm_client/cors/contact_options_responses.go b/api/crm/crm_client/cors/contact_options_responses.go new file mode 100644 index 0000000..6d32456 --- /dev/null +++ b/api/crm/crm_client/cors/contact_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// ContactOptionsReader is a Reader for the ContactOptions structure. +type ContactOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ContactOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewContactOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewContactOptionsOK creates a ContactOptionsOK with default headers values +func NewContactOptionsOK() *ContactOptionsOK { + return &ContactOptionsOK{} +} + +/* ContactOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type ContactOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *ContactOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /contacts][%d] contactOptionsOK ", 200) +} + +func (o *ContactOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/crm/crm_client/cors/cors_client.go b/api/crm/crm_client/cors/cors_client.go new file mode 100644 index 0000000..81d9a1c --- /dev/null +++ b/api/crm/crm_client/cors/cors_client.go @@ -0,0 +1,363 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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 cors API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for cors 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 { + AccountOptions(params *AccountOptionsParams, opts ...ClientOption) (*AccountOptionsOK, error) + + AccountOptionsObservable(params *AccountOptionsObservableParams, opts ...ClientOption) (*AccountOptionsObservableOK, error) + + CompanyObservableOptions(params *CompanyObservableOptionsParams, opts ...ClientOption) (*CompanyObservableOptionsOK, error) + + CompanyOptions(params *CompanyOptionsParams, opts ...ClientOption) (*CompanyOptionsOK, error) + + ContactOptions(params *ContactOptionsParams, opts ...ClientOption) (*ContactOptionsOK, error) + + ContactOptionsObservable(params *ContactOptionsObservableParams, opts ...ClientOption) (*ContactOptionsObservableOK, error) + + LeadOptions(params *LeadOptionsParams, opts ...ClientOption) (*LeadOptionsOK, error) + + LeadOptionsObservable(params *LeadOptionsObservableParams, opts ...ClientOption) (*LeadOptionsObservableOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + AccountOptions CORS support +*/ +func (a *Client) AccountOptions(params *AccountOptionsParams, opts ...ClientOption) (*AccountOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAccountOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "accountOptions", + Method: "OPTIONS", + PathPattern: "/accounts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &AccountOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*AccountOptionsOK) + 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 accountOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + AccountOptionsObservable CORS support +*/ +func (a *Client) AccountOptionsObservable(params *AccountOptionsObservableParams, opts ...ClientOption) (*AccountOptionsObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAccountOptionsObservableParams() + } + op := &runtime.ClientOperation{ + ID: "accountOptionsObservable", + Method: "OPTIONS", + PathPattern: "/accounts/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &AccountOptionsObservableReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*AccountOptionsObservableOK) + 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 accountOptionsObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + CompanyObservableOptions CORS support +*/ +func (a *Client) CompanyObservableOptions(params *CompanyObservableOptionsParams, opts ...ClientOption) (*CompanyObservableOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCompanyObservableOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "companyObservableOptions", + Method: "OPTIONS", + PathPattern: "/companies/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CompanyObservableOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CompanyObservableOptionsOK) + 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 companyObservableOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + CompanyOptions CORS support +*/ +func (a *Client) CompanyOptions(params *CompanyOptionsParams, opts ...ClientOption) (*CompanyOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCompanyOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "companyOptions", + Method: "OPTIONS", + PathPattern: "/companies", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CompanyOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CompanyOptionsOK) + 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 companyOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ContactOptions CORS support +*/ +func (a *Client) ContactOptions(params *ContactOptionsParams, opts ...ClientOption) (*ContactOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewContactOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "contactOptions", + Method: "OPTIONS", + PathPattern: "/contacts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ContactOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ContactOptionsOK) + 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 contactOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ContactOptionsObservable CORS support +*/ +func (a *Client) ContactOptionsObservable(params *ContactOptionsObservableParams, opts ...ClientOption) (*ContactOptionsObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewContactOptionsObservableParams() + } + op := &runtime.ClientOperation{ + ID: "contactOptionsObservable", + Method: "OPTIONS", + PathPattern: "/contacts/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ContactOptionsObservableReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ContactOptionsObservableOK) + 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 contactOptionsObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + LeadOptions CORS support +*/ +func (a *Client) LeadOptions(params *LeadOptionsParams, opts ...ClientOption) (*LeadOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewLeadOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "leadOptions", + Method: "OPTIONS", + PathPattern: "/leads", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &LeadOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*LeadOptionsOK) + 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 leadOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + LeadOptionsObservable CORS support +*/ +func (a *Client) LeadOptionsObservable(params *LeadOptionsObservableParams, opts ...ClientOption) (*LeadOptionsObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewLeadOptionsObservableParams() + } + op := &runtime.ClientOperation{ + ID: "leadOptionsObservable", + Method: "OPTIONS", + PathPattern: "/leads/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &LeadOptionsObservableReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*LeadOptionsObservableOK) + 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 leadOptionsObservable: 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 +} diff --git a/api/crm/crm_client/cors/lead_options_observable_parameters.go b/api/crm/crm_client/cors/lead_options_observable_parameters.go new file mode 100644 index 0000000..16cbded --- /dev/null +++ b/api/crm/crm_client/cors/lead_options_observable_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewLeadOptionsObservableParams creates a new LeadOptionsObservableParams 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 NewLeadOptionsObservableParams() *LeadOptionsObservableParams { + return &LeadOptionsObservableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewLeadOptionsObservableParamsWithTimeout creates a new LeadOptionsObservableParams object +// with the ability to set a timeout on a request. +func NewLeadOptionsObservableParamsWithTimeout(timeout time.Duration) *LeadOptionsObservableParams { + return &LeadOptionsObservableParams{ + timeout: timeout, + } +} + +// NewLeadOptionsObservableParamsWithContext creates a new LeadOptionsObservableParams object +// with the ability to set a context for a request. +func NewLeadOptionsObservableParamsWithContext(ctx context.Context) *LeadOptionsObservableParams { + return &LeadOptionsObservableParams{ + Context: ctx, + } +} + +// NewLeadOptionsObservableParamsWithHTTPClient creates a new LeadOptionsObservableParams object +// with the ability to set a custom HTTPClient for a request. +func NewLeadOptionsObservableParamsWithHTTPClient(client *http.Client) *LeadOptionsObservableParams { + return &LeadOptionsObservableParams{ + HTTPClient: client, + } +} + +/* LeadOptionsObservableParams contains all the parameters to send to the API endpoint + for the lead options observable operation. + + Typically these are written to a http.Request. +*/ +type LeadOptionsObservableParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the lead options observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *LeadOptionsObservableParams) WithDefaults() *LeadOptionsObservableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the lead options observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *LeadOptionsObservableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the lead options observable params +func (o *LeadOptionsObservableParams) WithTimeout(timeout time.Duration) *LeadOptionsObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the lead options observable params +func (o *LeadOptionsObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the lead options observable params +func (o *LeadOptionsObservableParams) WithContext(ctx context.Context) *LeadOptionsObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the lead options observable params +func (o *LeadOptionsObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the lead options observable params +func (o *LeadOptionsObservableParams) WithHTTPClient(client *http.Client) *LeadOptionsObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the lead options observable params +func (o *LeadOptionsObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *LeadOptionsObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/crm/crm_client/cors/lead_options_observable_responses.go b/api/crm/crm_client/cors/lead_options_observable_responses.go new file mode 100644 index 0000000..6655720 --- /dev/null +++ b/api/crm/crm_client/cors/lead_options_observable_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// LeadOptionsObservableReader is a Reader for the LeadOptionsObservable structure. +type LeadOptionsObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *LeadOptionsObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewLeadOptionsObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewLeadOptionsObservableOK creates a LeadOptionsObservableOK with default headers values +func NewLeadOptionsObservableOK() *LeadOptionsObservableOK { + return &LeadOptionsObservableOK{} +} + +/* LeadOptionsObservableOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type LeadOptionsObservableOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *LeadOptionsObservableOK) Error() string { + return fmt.Sprintf("[OPTIONS /leads/observable][%d] leadOptionsObservableOK ", 200) +} + +func (o *LeadOptionsObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/crm/crm_client/cors/lead_options_parameters.go b/api/crm/crm_client/cors/lead_options_parameters.go new file mode 100644 index 0000000..1ad925a --- /dev/null +++ b/api/crm/crm_client/cors/lead_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewLeadOptionsParams creates a new LeadOptionsParams 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 NewLeadOptionsParams() *LeadOptionsParams { + return &LeadOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewLeadOptionsParamsWithTimeout creates a new LeadOptionsParams object +// with the ability to set a timeout on a request. +func NewLeadOptionsParamsWithTimeout(timeout time.Duration) *LeadOptionsParams { + return &LeadOptionsParams{ + timeout: timeout, + } +} + +// NewLeadOptionsParamsWithContext creates a new LeadOptionsParams object +// with the ability to set a context for a request. +func NewLeadOptionsParamsWithContext(ctx context.Context) *LeadOptionsParams { + return &LeadOptionsParams{ + Context: ctx, + } +} + +// NewLeadOptionsParamsWithHTTPClient creates a new LeadOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewLeadOptionsParamsWithHTTPClient(client *http.Client) *LeadOptionsParams { + return &LeadOptionsParams{ + HTTPClient: client, + } +} + +/* LeadOptionsParams contains all the parameters to send to the API endpoint + for the lead options operation. + + Typically these are written to a http.Request. +*/ +type LeadOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the lead options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *LeadOptionsParams) WithDefaults() *LeadOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the lead options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *LeadOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the lead options params +func (o *LeadOptionsParams) WithTimeout(timeout time.Duration) *LeadOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the lead options params +func (o *LeadOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the lead options params +func (o *LeadOptionsParams) WithContext(ctx context.Context) *LeadOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the lead options params +func (o *LeadOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the lead options params +func (o *LeadOptionsParams) WithHTTPClient(client *http.Client) *LeadOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the lead options params +func (o *LeadOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *LeadOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/crm/crm_client/cors/lead_options_responses.go b/api/crm/crm_client/cors/lead_options_responses.go new file mode 100644 index 0000000..b6f4aa6 --- /dev/null +++ b/api/crm/crm_client/cors/lead_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// LeadOptionsReader is a Reader for the LeadOptions structure. +type LeadOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *LeadOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewLeadOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewLeadOptionsOK creates a LeadOptionsOK with default headers values +func NewLeadOptionsOK() *LeadOptionsOK { + return &LeadOptionsOK{} +} + +/* LeadOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type LeadOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *LeadOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /leads][%d] leadOptionsOK ", 200) +} + +func (o *LeadOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/crm/crm_client/crm_client.go b/api/crm/crm_client/crm_client.go new file mode 100644 index 0000000..e8c1188 --- /dev/null +++ b/api/crm/crm_client/crm_client.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + + "code.tnxs.net/telnexus/lib/api/crm/crm_client/accounts" + "code.tnxs.net/telnexus/lib/api/crm/crm_client/companies" + "code.tnxs.net/telnexus/lib/api/crm/crm_client/contacts" + "code.tnxs.net/telnexus/lib/api/crm/crm_client/cors" + "code.tnxs.net/telnexus/lib/api/crm/crm_client/leads" +) + +// Default crm HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "crm.infra.tnxs.net:8080" + // 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 +var DefaultSchemes = []string{"http"} + +// NewHTTPClient creates a new crm HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Crm { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new crm HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Crm { + // ensure nullable parameters have default + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new crm client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Crm { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Crm) + cli.Transport = transport + cli.Accounts = accounts.New(transport, formats) + cli.Companies = companies.New(transport, formats) + cli.Contacts = contacts.New(transport, formats) + cli.Cors = cors.New(transport, formats) + cli.Leads = leads.New(transport, formats) + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// Crm is a client for crm +type Crm struct { + Accounts accounts.ClientService + + Companies companies.ClientService + + Contacts contacts.ClientService + + Cors cors.ClientService + + Leads leads.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Crm) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.Accounts.SetTransport(transport) + c.Companies.SetTransport(transport) + c.Contacts.SetTransport(transport) + c.Cors.SetTransport(transport) + c.Leads.SetTransport(transport) +} diff --git a/api/crm/crm_client/leads/delete_lead_parameters.go b/api/crm/crm_client/leads/delete_lead_parameters.go new file mode 100644 index 0000000..b2f2723 --- /dev/null +++ b/api/crm/crm_client/leads/delete_lead_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteLeadParams creates a new DeleteLeadParams 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 NewDeleteLeadParams() *DeleteLeadParams { + return &DeleteLeadParams{ + timeout: 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, + } +} + +// NewDeleteLeadParamsWithContext creates a new DeleteLeadParams object +// with the ability to set a context for a request. +func NewDeleteLeadParamsWithContext(ctx context.Context) *DeleteLeadParams { + return &DeleteLeadParams{ + Context: ctx, + } +} + +// NewDeleteLeadParamsWithHTTPClient creates a new DeleteLeadParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteLeadParamsWithHTTPClient(client *http.Client) *DeleteLeadParams { + return &DeleteLeadParams{ + HTTPClient: client, + } +} + +/* DeleteLeadParams contains all the parameters to send to the API endpoint + for the delete lead operation. + + Typically these are written to a http.Request. +*/ +type DeleteLeadParams struct { + + /* LeadID. + + Telnexus Lead record ID + */ + LeadID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete lead params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteLeadParams) WithDefaults() *DeleteLeadParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete lead params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteLeadParams) SetDefaults() { + // no default values defined for this parameter +} + +// 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 +func (o *DeleteLeadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete lead params +func (o *DeleteLeadParams) WithContext(ctx context.Context) *DeleteLeadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete lead params +func (o *DeleteLeadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// 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 +func (o *DeleteLeadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// 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 +func (o *DeleteLeadParams) SetLeadID(leadID *string) { + o.LeadID = leadID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteLeadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.LeadID != nil { + + // query param leadId + var qrLeadID string + + if o.LeadID != nil { + qrLeadID = *o.LeadID + } + qLeadID := qrLeadID + if qLeadID != "" { + + if err := r.SetQueryParam("leadId", qLeadID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/crm/crm_client/leads/delete_lead_responses.go b/api/crm/crm_client/leads/delete_lead_responses.go new file mode 100644 index 0000000..9a65160 --- /dev/null +++ b/api/crm/crm_client/leads/delete_lead_responses.go @@ -0,0 +1,315 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/crm/crm_models" +) + +// DeleteLeadReader is a Reader for the DeleteLead structure. +type DeleteLeadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteLeadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteLeadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeleteLeadUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteLeadForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteLeadNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewDeleteLeadUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteLeadInternalServerError() + 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()) + } +} + +// NewDeleteLeadOK creates a DeleteLeadOK with default headers values +func NewDeleteLeadOK() *DeleteLeadOK { + return &DeleteLeadOK{} +} + +/* DeleteLeadOK describes a response with status code 200, with default header values. + +Telnexus Response with Message Objects with Delete Status +*/ +type DeleteLeadOK struct { + AccessControlAllowOrigin string + + Payload *crm_models.DeleteResponse +} + +func (o *DeleteLeadOK) Error() string { + return fmt.Sprintf("[DELETE /leads][%d] deleteLeadOK %+v", 200, o.Payload) +} +func (o *DeleteLeadOK) GetPayload() *crm_models.DeleteResponse { + return o.Payload +} + +func (o *DeleteLeadOK) 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.DeleteResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteLeadUnauthorized creates a DeleteLeadUnauthorized with default headers values +func NewDeleteLeadUnauthorized() *DeleteLeadUnauthorized { + return &DeleteLeadUnauthorized{} +} + +/* DeleteLeadUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type DeleteLeadUnauthorized struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *DeleteLeadUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /leads][%d] deleteLeadUnauthorized %+v", 401, o.Payload) +} +func (o *DeleteLeadUnauthorized) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *DeleteLeadUnauthorized) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteLeadForbidden creates a DeleteLeadForbidden with default headers values +func NewDeleteLeadForbidden() *DeleteLeadForbidden { + return &DeleteLeadForbidden{} +} + +/* DeleteLeadForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type DeleteLeadForbidden struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *DeleteLeadForbidden) Error() string { + return fmt.Sprintf("[DELETE /leads][%d] deleteLeadForbidden %+v", 403, o.Payload) +} +func (o *DeleteLeadForbidden) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *DeleteLeadForbidden) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteLeadNotFound creates a DeleteLeadNotFound with default headers values +func NewDeleteLeadNotFound() *DeleteLeadNotFound { + return &DeleteLeadNotFound{} +} + +/* DeleteLeadNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type DeleteLeadNotFound struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *DeleteLeadNotFound) Error() string { + return fmt.Sprintf("[DELETE /leads][%d] deleteLeadNotFound %+v", 404, o.Payload) +} +func (o *DeleteLeadNotFound) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *DeleteLeadNotFound) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteLeadUnprocessableEntity creates a DeleteLeadUnprocessableEntity with default headers values +func NewDeleteLeadUnprocessableEntity() *DeleteLeadUnprocessableEntity { + return &DeleteLeadUnprocessableEntity{} +} + +/* DeleteLeadUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type DeleteLeadUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *DeleteLeadUnprocessableEntity) Error() string { + return fmt.Sprintf("[DELETE /leads][%d] deleteLeadUnprocessableEntity %+v", 422, o.Payload) +} +func (o *DeleteLeadUnprocessableEntity) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *DeleteLeadUnprocessableEntity) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteLeadInternalServerError creates a DeleteLeadInternalServerError with default headers values +func NewDeleteLeadInternalServerError() *DeleteLeadInternalServerError { + return &DeleteLeadInternalServerError{} +} + +/* DeleteLeadInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type DeleteLeadInternalServerError struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *DeleteLeadInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /leads][%d] deleteLeadInternalServerError %+v", 500, o.Payload) +} +func (o *DeleteLeadInternalServerError) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *DeleteLeadInternalServerError) 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 && err != io.EOF { + return err + } + + return nil +} diff --git a/api/crm/crm_client/leads/get_leads_observable_parameters.go b/api/crm/crm_client/leads/get_leads_observable_parameters.go new file mode 100644 index 0000000..0bff9c6 --- /dev/null +++ b/api/crm/crm_client/leads/get_leads_observable_parameters.go @@ -0,0 +1,233 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetLeadsObservableParams creates a new GetLeadsObservableParams 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 NewGetLeadsObservableParams() *GetLeadsObservableParams { + return &GetLeadsObservableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetLeadsObservableParamsWithTimeout creates a new GetLeadsObservableParams object +// with the ability to set a timeout on a request. +func NewGetLeadsObservableParamsWithTimeout(timeout time.Duration) *GetLeadsObservableParams { + return &GetLeadsObservableParams{ + timeout: timeout, + } +} + +// NewGetLeadsObservableParamsWithContext creates a new GetLeadsObservableParams object +// with the ability to set a context for a request. +func NewGetLeadsObservableParamsWithContext(ctx context.Context) *GetLeadsObservableParams { + return &GetLeadsObservableParams{ + Context: ctx, + } +} + +// NewGetLeadsObservableParamsWithHTTPClient creates a new GetLeadsObservableParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetLeadsObservableParamsWithHTTPClient(client *http.Client) *GetLeadsObservableParams { + return &GetLeadsObservableParams{ + HTTPClient: client, + } +} + +/* GetLeadsObservableParams contains all the parameters to send to the API endpoint + for the get leads observable operation. + + Typically these are written to a http.Request. +*/ +type GetLeadsObservableParams struct { + + /* Email. + + Email address used for identity lookup + */ + Email *string + + /* LeadID. + + Telnexus Lead record ID + */ + LeadID *string + + /* Name. + + The Name of this Object + */ + Name *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get leads observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLeadsObservableParams) WithDefaults() *GetLeadsObservableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get leads observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLeadsObservableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get leads observable params +func (o *GetLeadsObservableParams) WithTimeout(timeout time.Duration) *GetLeadsObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get leads observable params +func (o *GetLeadsObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get leads observable params +func (o *GetLeadsObservableParams) WithContext(ctx context.Context) *GetLeadsObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get leads observable params +func (o *GetLeadsObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get leads observable params +func (o *GetLeadsObservableParams) WithHTTPClient(client *http.Client) *GetLeadsObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get leads observable params +func (o *GetLeadsObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEmail adds the email to the get leads observable params +func (o *GetLeadsObservableParams) WithEmail(email *string) *GetLeadsObservableParams { + o.SetEmail(email) + return o +} + +// SetEmail adds the email to the get leads observable params +func (o *GetLeadsObservableParams) SetEmail(email *string) { + o.Email = email +} + +// WithLeadID adds the leadID to the get leads observable params +func (o *GetLeadsObservableParams) WithLeadID(leadID *string) *GetLeadsObservableParams { + o.SetLeadID(leadID) + return o +} + +// SetLeadID adds the leadId to the get leads observable params +func (o *GetLeadsObservableParams) SetLeadID(leadID *string) { + o.LeadID = leadID +} + +// WithName adds the name to the get leads observable params +func (o *GetLeadsObservableParams) WithName(name *string) *GetLeadsObservableParams { + o.SetName(name) + return o +} + +// SetName adds the name to the get leads observable params +func (o *GetLeadsObservableParams) SetName(name *string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *GetLeadsObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Email != nil { + + // query param email + var qrEmail string + + if o.Email != nil { + qrEmail = *o.Email + } + qEmail := qrEmail + if qEmail != "" { + + if err := r.SetQueryParam("email", qEmail); err != nil { + return err + } + } + } + + if o.LeadID != nil { + + // query param leadId + var qrLeadID string + + if o.LeadID != nil { + qrLeadID = *o.LeadID + } + qLeadID := qrLeadID + if qLeadID != "" { + + if err := r.SetQueryParam("leadId", qLeadID); err != nil { + return err + } + } + } + + if o.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/crm/crm_client/leads/get_leads_observable_responses.go b/api/crm/crm_client/leads/get_leads_observable_responses.go new file mode 100644 index 0000000..8fce2dc --- /dev/null +++ b/api/crm/crm_client/leads/get_leads_observable_responses.go @@ -0,0 +1,321 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/crm/crm_models" +) + +// GetLeadsObservableReader is a Reader for the GetLeadsObservable structure. +type GetLeadsObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetLeadsObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetLeadsObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetLeadsObservableUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetLeadsObservableForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetLeadsObservableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetLeadsObservableUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetLeadsObservableInternalServerError() + 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()) + } +} + +// NewGetLeadsObservableOK creates a GetLeadsObservableOK with default headers values +func NewGetLeadsObservableOK() *GetLeadsObservableOK { + return &GetLeadsObservableOK{} +} + +/* GetLeadsObservableOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of Lead objects +*/ +type GetLeadsObservableOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload []*crm_models.Lead +} + +func (o *GetLeadsObservableOK) Error() string { + return fmt.Sprintf("[GET /leads/observable][%d] getLeadsObservableOK %+v", 200, o.Payload) +} +func (o *GetLeadsObservableOK) GetPayload() []*crm_models.Lead { + return o.Payload +} + +func (o *GetLeadsObservableOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLeadsObservableUnauthorized creates a GetLeadsObservableUnauthorized with default headers values +func NewGetLeadsObservableUnauthorized() *GetLeadsObservableUnauthorized { + return &GetLeadsObservableUnauthorized{} +} + +/* GetLeadsObservableUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetLeadsObservableUnauthorized struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetLeadsObservableUnauthorized) Error() string { + return fmt.Sprintf("[GET /leads/observable][%d] getLeadsObservableUnauthorized %+v", 401, o.Payload) +} +func (o *GetLeadsObservableUnauthorized) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetLeadsObservableUnauthorized) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetLeadsObservableForbidden creates a GetLeadsObservableForbidden with default headers values +func NewGetLeadsObservableForbidden() *GetLeadsObservableForbidden { + return &GetLeadsObservableForbidden{} +} + +/* GetLeadsObservableForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetLeadsObservableForbidden struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetLeadsObservableForbidden) Error() string { + return fmt.Sprintf("[GET /leads/observable][%d] getLeadsObservableForbidden %+v", 403, o.Payload) +} +func (o *GetLeadsObservableForbidden) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetLeadsObservableForbidden) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetLeadsObservableNotFound creates a GetLeadsObservableNotFound with default headers values +func NewGetLeadsObservableNotFound() *GetLeadsObservableNotFound { + return &GetLeadsObservableNotFound{} +} + +/* GetLeadsObservableNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetLeadsObservableNotFound struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetLeadsObservableNotFound) Error() string { + return fmt.Sprintf("[GET /leads/observable][%d] getLeadsObservableNotFound %+v", 404, o.Payload) +} +func (o *GetLeadsObservableNotFound) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetLeadsObservableNotFound) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetLeadsObservableUnprocessableEntity creates a GetLeadsObservableUnprocessableEntity with default headers values +func NewGetLeadsObservableUnprocessableEntity() *GetLeadsObservableUnprocessableEntity { + return &GetLeadsObservableUnprocessableEntity{} +} + +/* GetLeadsObservableUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetLeadsObservableUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetLeadsObservableUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /leads/observable][%d] getLeadsObservableUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetLeadsObservableUnprocessableEntity) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetLeadsObservableUnprocessableEntity) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetLeadsObservableInternalServerError creates a GetLeadsObservableInternalServerError with default headers values +func NewGetLeadsObservableInternalServerError() *GetLeadsObservableInternalServerError { + return &GetLeadsObservableInternalServerError{} +} + +/* GetLeadsObservableInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetLeadsObservableInternalServerError struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetLeadsObservableInternalServerError) Error() string { + return fmt.Sprintf("[GET /leads/observable][%d] getLeadsObservableInternalServerError %+v", 500, o.Payload) +} +func (o *GetLeadsObservableInternalServerError) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetLeadsObservableInternalServerError) 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 && err != io.EOF { + return err + } + + return nil +} diff --git a/api/crm/crm_client/leads/get_leads_parameters.go b/api/crm/crm_client/leads/get_leads_parameters.go new file mode 100644 index 0000000..3ade243 --- /dev/null +++ b/api/crm/crm_client/leads/get_leads_parameters.go @@ -0,0 +1,306 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + + "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" +) + +// NewGetLeadsParams creates a new GetLeadsParams 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 NewGetLeadsParams() *GetLeadsParams { + return &GetLeadsParams{ + timeout: 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, + } +} + +// NewGetLeadsParamsWithContext creates a new GetLeadsParams object +// with the ability to set a context for a request. +func NewGetLeadsParamsWithContext(ctx context.Context) *GetLeadsParams { + return &GetLeadsParams{ + Context: ctx, + } +} + +// NewGetLeadsParamsWithHTTPClient creates a new GetLeadsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetLeadsParamsWithHTTPClient(client *http.Client) *GetLeadsParams { + return &GetLeadsParams{ + HTTPClient: client, + } +} + +/* GetLeadsParams contains all the parameters to send to the API endpoint + for the get leads operation. + + Typically these are written to a http.Request. +*/ +type GetLeadsParams struct { + + /* Email. + + Email address used for identity lookup + */ + Email *string + + /* LeadID. + + Telnexus Lead record ID + */ + LeadID *string + + /* Limit. + + How many objects to return at one time + + Format: int64 + */ + Limit *int64 + + /* Name. + + The Name of this Object + */ + Name *string + + /* 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 leads params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLeadsParams) WithDefaults() *GetLeadsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get leads params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLeadsParams) SetDefaults() { + // no default values defined for this parameter +} + +// 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 +func (o *GetLeadsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get leads params +func (o *GetLeadsParams) WithContext(ctx context.Context) *GetLeadsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get leads params +func (o *GetLeadsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// 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 +func (o *GetLeadsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// 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 +func (o *GetLeadsParams) SetEmail(email *string) { + o.Email = email +} + +// 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 +func (o *GetLeadsParams) SetLeadID(leadID *string) { + o.LeadID = leadID +} + +// 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 +func (o *GetLeadsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// 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 +func (o *GetLeadsParams) SetName(name *string) { + o.Name = name +} + +// 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 +func (o *GetLeadsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetLeadsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Email != nil { + + // query param email + var qrEmail string + + if o.Email != nil { + qrEmail = *o.Email + } + qEmail := qrEmail + if qEmail != "" { + + if err := r.SetQueryParam("email", qEmail); err != nil { + return err + } + } + } + + if o.LeadID != nil { + + // query param leadId + var qrLeadID string + + if o.LeadID != nil { + qrLeadID = *o.LeadID + } + qLeadID := qrLeadID + if qLeadID != "" { + + if err := r.SetQueryParam("leadId", qLeadID); 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.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); 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 +} diff --git a/api/crm/crm_client/leads/get_leads_responses.go b/api/crm/crm_client/leads/get_leads_responses.go new file mode 100644 index 0000000..09e0914 --- /dev/null +++ b/api/crm/crm_client/leads/get_leads_responses.go @@ -0,0 +1,323 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/crm/crm_models" +) + +// GetLeadsReader is a Reader for the GetLeads structure. +type GetLeadsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetLeadsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetLeadsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetLeadsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetLeadsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetLeadsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetLeadsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetLeadsInternalServerError() + 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()) + } +} + +// NewGetLeadsOK creates a GetLeadsOK with default headers values +func NewGetLeadsOK() *GetLeadsOK { + return &GetLeadsOK{} +} + +/* GetLeadsOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of Lead objects +*/ +type GetLeadsOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *crm_models.LeadResponse +} + +func (o *GetLeadsOK) Error() string { + return fmt.Sprintf("[GET /leads][%d] getLeadsOK %+v", 200, o.Payload) +} +func (o *GetLeadsOK) GetPayload() *crm_models.LeadResponse { + return o.Payload +} + +func (o *GetLeadsOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(crm_models.LeadResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLeadsUnauthorized creates a GetLeadsUnauthorized with default headers values +func NewGetLeadsUnauthorized() *GetLeadsUnauthorized { + return &GetLeadsUnauthorized{} +} + +/* GetLeadsUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetLeadsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetLeadsUnauthorized) Error() string { + return fmt.Sprintf("[GET /leads][%d] getLeadsUnauthorized %+v", 401, o.Payload) +} +func (o *GetLeadsUnauthorized) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetLeadsUnauthorized) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetLeadsForbidden creates a GetLeadsForbidden with default headers values +func NewGetLeadsForbidden() *GetLeadsForbidden { + return &GetLeadsForbidden{} +} + +/* GetLeadsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetLeadsForbidden struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetLeadsForbidden) Error() string { + return fmt.Sprintf("[GET /leads][%d] getLeadsForbidden %+v", 403, o.Payload) +} +func (o *GetLeadsForbidden) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetLeadsForbidden) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetLeadsNotFound creates a GetLeadsNotFound with default headers values +func NewGetLeadsNotFound() *GetLeadsNotFound { + return &GetLeadsNotFound{} +} + +/* GetLeadsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetLeadsNotFound struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetLeadsNotFound) Error() string { + return fmt.Sprintf("[GET /leads][%d] getLeadsNotFound %+v", 404, o.Payload) +} +func (o *GetLeadsNotFound) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetLeadsNotFound) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetLeadsUnprocessableEntity creates a GetLeadsUnprocessableEntity with default headers values +func NewGetLeadsUnprocessableEntity() *GetLeadsUnprocessableEntity { + return &GetLeadsUnprocessableEntity{} +} + +/* GetLeadsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetLeadsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetLeadsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /leads][%d] getLeadsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetLeadsUnprocessableEntity) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetLeadsUnprocessableEntity) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewGetLeadsInternalServerError creates a GetLeadsInternalServerError with default headers values +func NewGetLeadsInternalServerError() *GetLeadsInternalServerError { + return &GetLeadsInternalServerError{} +} + +/* GetLeadsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetLeadsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *GetLeadsInternalServerError) Error() string { + return fmt.Sprintf("[GET /leads][%d] getLeadsInternalServerError %+v", 500, o.Payload) +} +func (o *GetLeadsInternalServerError) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *GetLeadsInternalServerError) 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 && err != io.EOF { + return err + } + + return nil +} diff --git a/api/crm/crm_client/leads/leads_client.go b/api/crm/crm_client/leads/leads_client.go new file mode 100644 index 0000000..bb15861 --- /dev/null +++ b/api/crm/crm_client/leads/leads_client.go @@ -0,0 +1,258 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new leads API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for leads 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 { + DeleteLead(params *DeleteLeadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteLeadOK, error) + + GetLeads(params *GetLeadsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLeadsOK, error) + + GetLeadsObservable(params *GetLeadsObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLeadsObservableOK, error) + + PostLeads(params *PostLeadsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostLeadsOK, error) + + PutLeads(params *PutLeadsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutLeadsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteLead deletes a contact + + Delete Telnexus Lead record +*/ +func (a *Client) DeleteLead(params *DeleteLeadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteLeadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteLeadParams() + } + op := &runtime.ClientOperation{ + ID: "deleteLead", + Method: "DELETE", + PathPattern: "/leads", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + 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) + if err != nil { + return nil, err + } + 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 + 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 +*/ +func (a *Client) GetLeads(params *GetLeadsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLeadsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLeadsParams() + } + op := &runtime.ClientOperation{ + ID: "getLeads", + Method: "GET", + PathPattern: "/leads", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + 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) + if err != nil { + return nil, err + } + 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 + 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) +} + +/* + GetLeadsObservable gets telnexus leads in an observable array + + A list of leads in a simple JSON array +*/ +func (a *Client) GetLeadsObservable(params *GetLeadsObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLeadsObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLeadsObservableParams() + } + op := &runtime.ClientOperation{ + ID: "getLeadsObservable", + Method: "GET", + PathPattern: "/leads/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetLeadsObservableReader{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.(*GetLeadsObservableOK) + 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 getLeadsObservable: 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 +*/ +func (a *Client) PostLeads(params *PostLeadsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostLeadsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostLeadsParams() + } + op := &runtime.ClientOperation{ + ID: "postLeads", + Method: "POST", + PathPattern: "/leads", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + 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) + if err != nil { + return nil, err + } + 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 + 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 +*/ +func (a *Client) PutLeads(params *PutLeadsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutLeadsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutLeadsParams() + } + op := &runtime.ClientOperation{ + ID: "putLeads", + Method: "PUT", + PathPattern: "/leads", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + 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) + if err != nil { + return nil, err + } + 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 + 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) { + a.transport = transport +} diff --git a/api/crm/crm_client/leads/post_leads_parameters.go b/api/crm/crm_client/leads/post_leads_parameters.go new file mode 100644 index 0000000..5933b59 --- /dev/null +++ b/api/crm/crm_client/leads/post_leads_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + + "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/telnexus/lib/api/crm/crm_models" +) + +// NewPostLeadsParams creates a new PostLeadsParams 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 NewPostLeadsParams() *PostLeadsParams { + return &PostLeadsParams{ + timeout: 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, + } +} + +// NewPostLeadsParamsWithContext creates a new PostLeadsParams object +// with the ability to set a context for a request. +func NewPostLeadsParamsWithContext(ctx context.Context) *PostLeadsParams { + return &PostLeadsParams{ + Context: ctx, + } +} + +// NewPostLeadsParamsWithHTTPClient creates a new PostLeadsParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostLeadsParamsWithHTTPClient(client *http.Client) *PostLeadsParams { + return &PostLeadsParams{ + HTTPClient: client, + } +} + +/* PostLeadsParams contains all the parameters to send to the API endpoint + for the post leads operation. + + Typically these are written to a http.Request. +*/ +type PostLeadsParams struct { + + /* LeadRequest. + + An array of new Lead records + */ + LeadRequest *crm_models.LeadRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post leads params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostLeadsParams) WithDefaults() *PostLeadsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post leads params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostLeadsParams) SetDefaults() { + // no default values defined for this parameter +} + +// 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 +func (o *PostLeadsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post leads params +func (o *PostLeadsParams) WithContext(ctx context.Context) *PostLeadsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post leads params +func (o *PostLeadsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// 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 +func (o *PostLeadsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// 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 +func (o *PostLeadsParams) SetLeadRequest(leadRequest *crm_models.LeadRequest) { + o.LeadRequest = leadRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostLeadsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.LeadRequest != nil { + if err := r.SetBodyParam(o.LeadRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/crm/crm_client/leads/post_leads_responses.go b/api/crm/crm_client/leads/post_leads_responses.go new file mode 100644 index 0000000..59e5a28 --- /dev/null +++ b/api/crm/crm_client/leads/post_leads_responses.go @@ -0,0 +1,323 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/crm/crm_models" +) + +// PostLeadsReader is a Reader for the PostLeads structure. +type PostLeadsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostLeadsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostLeadsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostLeadsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostLeadsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostLeadsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostLeadsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostLeadsInternalServerError() + 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()) + } +} + +// NewPostLeadsOK creates a PostLeadsOK with default headers values +func NewPostLeadsOK() *PostLeadsOK { + return &PostLeadsOK{} +} + +/* PostLeadsOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of Lead objects +*/ +type PostLeadsOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *crm_models.LeadResponse +} + +func (o *PostLeadsOK) Error() string { + return fmt.Sprintf("[POST /leads][%d] postLeadsOK %+v", 200, o.Payload) +} +func (o *PostLeadsOK) GetPayload() *crm_models.LeadResponse { + return o.Payload +} + +func (o *PostLeadsOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(crm_models.LeadResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostLeadsUnauthorized creates a PostLeadsUnauthorized with default headers values +func NewPostLeadsUnauthorized() *PostLeadsUnauthorized { + return &PostLeadsUnauthorized{} +} + +/* PostLeadsUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostLeadsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PostLeadsUnauthorized) Error() string { + return fmt.Sprintf("[POST /leads][%d] postLeadsUnauthorized %+v", 401, o.Payload) +} +func (o *PostLeadsUnauthorized) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PostLeadsUnauthorized) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPostLeadsForbidden creates a PostLeadsForbidden with default headers values +func NewPostLeadsForbidden() *PostLeadsForbidden { + return &PostLeadsForbidden{} +} + +/* PostLeadsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostLeadsForbidden struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PostLeadsForbidden) Error() string { + return fmt.Sprintf("[POST /leads][%d] postLeadsForbidden %+v", 403, o.Payload) +} +func (o *PostLeadsForbidden) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PostLeadsForbidden) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPostLeadsNotFound creates a PostLeadsNotFound with default headers values +func NewPostLeadsNotFound() *PostLeadsNotFound { + return &PostLeadsNotFound{} +} + +/* PostLeadsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostLeadsNotFound struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PostLeadsNotFound) Error() string { + return fmt.Sprintf("[POST /leads][%d] postLeadsNotFound %+v", 404, o.Payload) +} +func (o *PostLeadsNotFound) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PostLeadsNotFound) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPostLeadsUnprocessableEntity creates a PostLeadsUnprocessableEntity with default headers values +func NewPostLeadsUnprocessableEntity() *PostLeadsUnprocessableEntity { + return &PostLeadsUnprocessableEntity{} +} + +/* PostLeadsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostLeadsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PostLeadsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /leads][%d] postLeadsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PostLeadsUnprocessableEntity) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PostLeadsUnprocessableEntity) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPostLeadsInternalServerError creates a PostLeadsInternalServerError with default headers values +func NewPostLeadsInternalServerError() *PostLeadsInternalServerError { + return &PostLeadsInternalServerError{} +} + +/* PostLeadsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostLeadsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PostLeadsInternalServerError) Error() string { + return fmt.Sprintf("[POST /leads][%d] postLeadsInternalServerError %+v", 500, o.Payload) +} +func (o *PostLeadsInternalServerError) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PostLeadsInternalServerError) 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 && err != io.EOF { + return err + } + + return nil +} diff --git a/api/crm/crm_client/leads/put_leads_parameters.go b/api/crm/crm_client/leads/put_leads_parameters.go new file mode 100644 index 0000000..2e0361e --- /dev/null +++ b/api/crm/crm_client/leads/put_leads_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + + "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/telnexus/lib/api/crm/crm_models" +) + +// NewPutLeadsParams creates a new PutLeadsParams 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 NewPutLeadsParams() *PutLeadsParams { + return &PutLeadsParams{ + timeout: 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, + } +} + +// NewPutLeadsParamsWithContext creates a new PutLeadsParams object +// with the ability to set a context for a request. +func NewPutLeadsParamsWithContext(ctx context.Context) *PutLeadsParams { + return &PutLeadsParams{ + Context: ctx, + } +} + +// NewPutLeadsParamsWithHTTPClient creates a new PutLeadsParams object +// with the ability to set a custom HTTPClient for a request. +func NewPutLeadsParamsWithHTTPClient(client *http.Client) *PutLeadsParams { + return &PutLeadsParams{ + HTTPClient: client, + } +} + +/* PutLeadsParams contains all the parameters to send to the API endpoint + for the put leads operation. + + Typically these are written to a http.Request. +*/ +type PutLeadsParams struct { + + /* LeadRequest. + + An array of new Lead records + */ + LeadRequest *crm_models.LeadRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put leads params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutLeadsParams) WithDefaults() *PutLeadsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put leads params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutLeadsParams) SetDefaults() { + // no default values defined for this parameter +} + +// 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 +func (o *PutLeadsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put leads params +func (o *PutLeadsParams) WithContext(ctx context.Context) *PutLeadsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put leads params +func (o *PutLeadsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// 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 +func (o *PutLeadsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// 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 +func (o *PutLeadsParams) SetLeadRequest(leadRequest *crm_models.LeadRequest) { + o.LeadRequest = leadRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutLeadsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.LeadRequest != nil { + if err := r.SetBodyParam(o.LeadRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/crm/crm_client/leads/put_leads_responses.go b/api/crm/crm_client/leads/put_leads_responses.go new file mode 100644 index 0000000..0c6d17b --- /dev/null +++ b/api/crm/crm_client/leads/put_leads_responses.go @@ -0,0 +1,323 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/crm/crm_models" +) + +// PutLeadsReader is a Reader for the PutLeads structure. +type PutLeadsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutLeadsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutLeadsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutLeadsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutLeadsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutLeadsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutLeadsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutLeadsInternalServerError() + 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()) + } +} + +// NewPutLeadsOK creates a PutLeadsOK with default headers values +func NewPutLeadsOK() *PutLeadsOK { + return &PutLeadsOK{} +} + +/* PutLeadsOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of Lead objects +*/ +type PutLeadsOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *crm_models.LeadResponse +} + +func (o *PutLeadsOK) Error() string { + return fmt.Sprintf("[PUT /leads][%d] putLeadsOK %+v", 200, o.Payload) +} +func (o *PutLeadsOK) GetPayload() *crm_models.LeadResponse { + return o.Payload +} + +func (o *PutLeadsOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(crm_models.LeadResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutLeadsUnauthorized creates a PutLeadsUnauthorized with default headers values +func NewPutLeadsUnauthorized() *PutLeadsUnauthorized { + return &PutLeadsUnauthorized{} +} + +/* PutLeadsUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutLeadsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PutLeadsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /leads][%d] putLeadsUnauthorized %+v", 401, o.Payload) +} +func (o *PutLeadsUnauthorized) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PutLeadsUnauthorized) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPutLeadsForbidden creates a PutLeadsForbidden with default headers values +func NewPutLeadsForbidden() *PutLeadsForbidden { + return &PutLeadsForbidden{} +} + +/* PutLeadsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PutLeadsForbidden struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PutLeadsForbidden) Error() string { + return fmt.Sprintf("[PUT /leads][%d] putLeadsForbidden %+v", 403, o.Payload) +} +func (o *PutLeadsForbidden) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PutLeadsForbidden) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPutLeadsNotFound creates a PutLeadsNotFound with default headers values +func NewPutLeadsNotFound() *PutLeadsNotFound { + return &PutLeadsNotFound{} +} + +/* PutLeadsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PutLeadsNotFound struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PutLeadsNotFound) Error() string { + return fmt.Sprintf("[PUT /leads][%d] putLeadsNotFound %+v", 404, o.Payload) +} +func (o *PutLeadsNotFound) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PutLeadsNotFound) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPutLeadsUnprocessableEntity creates a PutLeadsUnprocessableEntity with default headers values +func NewPutLeadsUnprocessableEntity() *PutLeadsUnprocessableEntity { + return &PutLeadsUnprocessableEntity{} +} + +/* PutLeadsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutLeadsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PutLeadsUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /leads][%d] putLeadsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PutLeadsUnprocessableEntity) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PutLeadsUnprocessableEntity) 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 && err != io.EOF { + return err + } + + return nil +} + +// NewPutLeadsInternalServerError creates a PutLeadsInternalServerError with default headers values +func NewPutLeadsInternalServerError() *PutLeadsInternalServerError { + return &PutLeadsInternalServerError{} +} + +/* PutLeadsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PutLeadsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *crm_models.Error +} + +func (o *PutLeadsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /leads][%d] putLeadsInternalServerError %+v", 500, o.Payload) +} +func (o *PutLeadsInternalServerError) GetPayload() *crm_models.Error { + return o.Payload +} + +func (o *PutLeadsInternalServerError) 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 && err != io.EOF { + return err + } + + return nil +} diff --git a/api/crm/crm_models/account.go b/api/crm/crm_models/account.go new file mode 100644 index 0000000..b8958ec --- /dev/null +++ b/api/crm/crm_models/account.go @@ -0,0 +1,482 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" +) + +// Account account +// +// swagger:model Account +type Account struct { + + // Account Number + AccountNumber string `json:"AccountNumber,omitempty"` + + // The marketing orgin of this account + AccountSource string `json:"AccountSource,omitempty"` + + // Active + Active bool `json:"Active,omitempty"` + + // For tax authorities, this account's administrative level, e.g. Local, County, State or Federal + AdministrativeLevel string `json:"AdministrativeLevel,omitempty"` + + // Rollup Tax Amount + Amount float64 `json:"Amount,omitempty"` + + // Amount Invoiced + AmountInvoiced float64 `json:"AmountInvoiced,omitempty"` + + // Amount Paid + AmountPaid float64 `json:"AmountPaid,omitempty"` + + // Annual Revenue Estimate + AnnualRevenue float64 `json:"AnnualRevenue,omitempty"` + + // Account Balance + Balance float64 `json:"Balance,omitempty"` + + // billing address + BillingAddress *Address `json:"BillingAddress,omitempty"` + + // Contact ID + BillingContactID string `json:"BillingContactID,omitempty"` + + // Billing Preference + BillingPreference string `json:"BillingPreference,omitempty"` + + // business address + BusinessAddress *Address `json:"BusinessAddress,omitempty"` + + // Is this a cannabis customer? + CannabisCustomer bool `json:"CannabisCustomer,omitempty"` + + // Channel Program Level Name + ChannelProgramLevelName string `json:"ChannelProgramLevelName,omitempty"` + + // Channel Program Name + ChannelProgramName string `json:"ChannelProgramName,omitempty"` + + // Client End Date + ClientEndDate string `json:"ClientEndDate,omitempty"` + + // Client Start Date + ClientStartDate string `json:"ClientStartDate,omitempty"` + + // The Company ID of this Account + CompanyID string `json:"CompanyID,omitempty"` + + // The Id of the geo coordinates of this account + CoordinateID string `json:"CoordinateID,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Customer ID from source system + CustomerID string `json:"CustomerID,omitempty"` + + // Customer Priority + CustomerPriority string `json:"CustomerPriority,omitempty"` + + // This Account's 'Doing Business As' name + DBA string `json:"DBA,omitempty"` + + // D-U-N-S Number + DUNSNumber string `json:"DUNSNumber,omitempty"` + + // D-n-B Company + DandBCompanyID string `json:"DandBCompanyID,omitempty"` + + // default address + DefaultAddress *Address `json:"DefaultAddress,omitempty"` + + // Default Backend ID + DefaultBackendID string `json:"DefaultBackendID,omitempty"` + + // Default Delivery Address Contact ID + DefaultDeliveryContactID string `json:"DefaultDeliveryContactID,omitempty"` + + // Default End User Contact ID + DefaultEndUserID string `json:"DefaultEndUserID,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // EIN + EIN string `json:"EIN,omitempty"` + + // Main Account Email + Email string `json:"Email,omitempty"` + + // Enrollment Status + EnrollmentStatus string `json:"EnrollmentStatus,omitempty"` + + // Fax + Fax string `json:"Fax,omitempty"` + + // Telnexus Account Id + ID string `json:"ID,omitempty"` + + // ISP Customer? + ISPCustomer bool `json:"ISPCustomer,omitempty"` + + // Industry + Industry string `json:"Industry,omitempty"` + + // Customer Portal Account + IsCustomerPortal bool `json:"IsCustomerPortal,omitempty"` + + // Partner Account + IsPartner bool `json:"IsPartner,omitempty"` + + // Data.com Key + JigSaw string `json:"JigSaw,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // MSP Customer? + MSPCustomer bool `json:"MSPCustomer,omitempty"` + + // NAICS Code + NAICSCode string `json:"NAICSCode,omitempty"` + + // NAICS Description + NAICSDesc string `json:"NAICSDesc,omitempty"` + + // Account Name + Name string `json:"Name,omitempty"` + + // Employee Count Estimate + NumberOfEmployees int64 `json:"NumberOfEmployees,omitempty"` + + // Number of Locations Estimate + NumberOfLocations int64 `json:"NumberOfLocations,omitempty"` + + // Open Charges + OpenCharges float64 `json:"OpenCharges,omitempty"` + + // Vendor Order Contact ID + OrderContactID string `json:"OrderContactID,omitempty"` + + // Order Email + OrderEmail string `json:"OrderEmail,omitempty"` + + // Account Owner User ID + OwnerID string `json:"OwnerID,omitempty"` + + // Ownership + Ownership string `json:"Ownership,omitempty"` + + // Parent Foreign Key + ParentFK string `json:"ParentFK,omitempty"` + + // Parent Account + ParentID string `json:"ParentID,omitempty"` + + // Phone + Phone string `json:"Phone,omitempty"` + + // The ID of the Place situs record that applies to this Account + PlaceID string `json:"PlaceID,omitempty"` + + // Tax Preparer Contact ID + PreparerID string `json:"PreparerID,omitempty"` + + // Rating + Rating string `json:"Rating,omitempty"` + + // Rating Engine identifier + RatingEngineID string `json:"RatingEngineID,omitempty"` + + // External Reference ID + Ref string `json:"Ref,omitempty"` + + // Rollup Revenue Base + RevenueBase float64 `json:"RevenueBase,omitempty"` + + // Rollup Revenue Net + RevenueNet float64 `json:"RevenueNet,omitempty"` + + // Rollup Revenue Not Taxable + RevenueNotTaxable float64 `json:"RevenueNotTaxable,omitempty"` + + // SIC Code + SIC string `json:"SIC,omitempty"` + + // SIC Description + SICDesc string `json:"SICDesc,omitempty"` + + // shipping address + ShippingAddress *Address `json:"ShippingAddress,omitempty"` + + // Shipping Census Tract + ShippingCensusTract string `json:"ShippingCensusTract,omitempty"` + + // Shipping Contact ID + ShippingConactID string `json:"ShippingConactID,omitempty"` + + // Shipping County + ShippingCounty string `json:"ShippingCounty,omitempty"` + + // Account Site + Site string `json:"Site,omitempty"` + + // Account Status + Status string `json:"Status,omitempty"` + + // Tax Exemption + TaxExemption string `json:"TaxExemption,omitempty"` + + // Rollup Tax On Tax + TaxOnTax float64 `json:"TaxOnTax,omitempty"` + + // Telecom Customer? + TelecomCustomer bool `json:"TelecomCustomer,omitempty"` + + // Tenant Identifier + TenantID string `json:"TenantID,omitempty"` + + // Ticker Symbol + TickerSymbol string `json:"TickerSymbol,omitempty"` + + // Tradestyle + TradeStyle string `json:"TradeStyle,omitempty"` + + // Type + Type string `json:"Type,omitempty"` + + // Unapplied Payments + UnappliedPayments float64 `json:"UnappliedPayments,omitempty"` + + // Rollup Unit Base + UnitBase float64 `json:"UnitBase,omitempty"` + + // Upsell Opportunity + UpsellOpportunity string `json:"UpsellOpportunity,omitempty"` + + // WHMCS Client ID + WHMCSClientID int64 `json:"WHMCSClientID,omitempty"` + + // Website + Website string `json:"Website,omitempty"` + + // Xero Contact ID + XeroContactID string `json:"XeroContactID,omitempty"` + + // Year Started + YearStarted string `json:"YearStarted,omitempty"` +} + +// Validate validates this account +func (m *Account) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBillingAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBusinessAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDefaultAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShippingAddress(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Account) validateBillingAddress(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("BillingAddress") + } + return err + } + } + + return nil +} + +func (m *Account) validateBusinessAddress(formats strfmt.Registry) error { + if swag.IsZero(m.BusinessAddress) { // not required + return nil + } + + if m.BusinessAddress != nil { + if err := m.BusinessAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("BusinessAddress") + } + return err + } + } + + return nil +} + +func (m *Account) validateDefaultAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DefaultAddress) { // not required + return nil + } + + if m.DefaultAddress != nil { + if err := m.DefaultAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("DefaultAddress") + } + return err + } + } + + return nil +} + +func (m *Account) validateShippingAddress(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("ShippingAddress") + } + return err + } + } + + return nil +} + +// ContextValidate validate this account based on the context it is used +func (m *Account) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBillingAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBusinessAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDefaultAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShippingAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Account) contextValidateBillingAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.BillingAddress != nil { + if err := m.BillingAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("BillingAddress") + } + return err + } + } + + return nil +} + +func (m *Account) contextValidateBusinessAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.BusinessAddress != nil { + if err := m.BusinessAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("BusinessAddress") + } + return err + } + } + + return nil +} + +func (m *Account) contextValidateDefaultAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.DefaultAddress != nil { + if err := m.DefaultAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("DefaultAddress") + } + return err + } + } + + return nil +} + +func (m *Account) contextValidateShippingAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.ShippingAddress != nil { + if err := m.ShippingAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ShippingAddress") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Account) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Account) UnmarshalBinary(b []byte) error { + var res Account + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/crm/crm_models/account_basic.go b/api/crm/crm_models/account_basic.go new file mode 100644 index 0000000..7ba126d --- /dev/null +++ b/api/crm/crm_models/account_basic.go @@ -0,0 +1,251 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" +) + +// AccountBasic account basic +// +// swagger:model AccountBasic +type AccountBasic struct { + + // Telnexus Account Number of the OEM/Reseller + AccountNumber string `json:"AccountNumber,omitempty"` + + // billing address + BillingAddress *Address `json:"BillingAddress,omitempty"` + + // Contact ID + BillingContactID string `json:"BillingContactID,omitempty"` + + // Telnexus OEM/Reseller Record Id + CompanyID string `json:"CompanyID,omitempty"` + + // The id of the Coordinate of the business establishment + CoordinateID string `json:"CoordinateID,omitempty"` + + // Taxpayer Customer Id designated by OEM/Reseller + CustomerID string `json:"CustomerID,omitempty"` + + // default address + DefaultAddress *Address `json:"DefaultAddress,omitempty"` + + // Default Backend ID + DefaultBackendID string `json:"DefaultBackendID,omitempty"` + + // Default Delivery Address Contact ID + DefaultDeliveryContactID string `json:"DefaultDeliveryContactID,omitempty"` + + // Contact ID + DefaultEndUserID string `json:"DefaultEndUserID,omitempty"` + + // Taxpayer Public Email Address + Email string `json:"Email,omitempty"` + + // Taxpayer Fax Number + Fax string `json:"Fax,omitempty"` + + // Taxpayer Account Record Id + ID string `json:"ID,omitempty"` + + // Taxpayer Account Name (ignored for Tax Processing) + Name string `json:"Name,omitempty"` + + // UUID Reference the master record that owns this item + ParentFK string `json:"ParentFK,omitempty"` + + // Taxpayer Public Phone Number + Phone string `json:"Phone,omitempty"` + + // Contact ID + PreparerID string `json:"PreparerID,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Shipping Address + ShippingAddress *Address `json:"ShippingAddress,omitempty"` + + // Contact ID + ShippingConactID string `json:"ShippingConactID,omitempty"` + + // Taxpayer Location Designation + Site string `json:"Site,omitempty"` + + // Tenant Identifier + TenantID string `json:"TenantID,omitempty"` + + // Account Type + Type string `json:"Type,omitempty"` + + // Taxpayer Website + Website string `json:"Website,omitempty"` +} + +// Validate validates this account basic +func (m *AccountBasic) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBillingAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDefaultAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShippingAddress(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AccountBasic) validateBillingAddress(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("BillingAddress") + } + return err + } + } + + return nil +} + +func (m *AccountBasic) validateDefaultAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DefaultAddress) { // not required + return nil + } + + if m.DefaultAddress != nil { + if err := m.DefaultAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("DefaultAddress") + } + return err + } + } + + return nil +} + +func (m *AccountBasic) validateShippingAddress(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("ShippingAddress") + } + return err + } + } + + return nil +} + +// ContextValidate validate this account basic based on the context it is used +func (m *AccountBasic) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBillingAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDefaultAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShippingAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AccountBasic) contextValidateBillingAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.BillingAddress != nil { + if err := m.BillingAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("BillingAddress") + } + return err + } + } + + return nil +} + +func (m *AccountBasic) contextValidateDefaultAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.DefaultAddress != nil { + if err := m.DefaultAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("DefaultAddress") + } + return err + } + } + + return nil +} + +func (m *AccountBasic) contextValidateShippingAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.ShippingAddress != nil { + if err := m.ShippingAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ShippingAddress") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *AccountBasic) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AccountBasic) UnmarshalBinary(b []byte) error { + var res AccountBasic + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/crm/crm_models/account_basic_response.go b/api/crm/crm_models/account_basic_response.go new file mode 100644 index 0000000..f00d75d --- /dev/null +++ b/api/crm/crm_models/account_basic_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AccountBasicResponse account basic response +// +// swagger:model AccountBasicResponse +type AccountBasicResponse struct { + + // data + Data []*AccountBasic `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this account basic response +func (m *AccountBasicResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AccountBasicResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *AccountBasicResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this account basic response based on the context it is used +func (m *AccountBasicResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AccountBasicResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *AccountBasicResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *AccountBasicResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AccountBasicResponse) UnmarshalBinary(b []byte) error { + var res AccountBasicResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/crm/crm_models/account_request.go b/api/crm/crm_models/account_request.go new file mode 100644 index 0000000..0ef1142 --- /dev/null +++ b/api/crm/crm_models/account_request.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AccountRequest An array of Account objects with Contacts +// +// swagger:model AccountRequest +type AccountRequest struct { + + // data + Data []*Account `json:"Data"` +} + +// Validate validates this account request +func (m *AccountRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AccountRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this account request based on the context it is used +func (m *AccountRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AccountRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *AccountRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AccountRequest) UnmarshalBinary(b []byte) error { + var res AccountRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/crm/crm_models/account_response.go b/api/crm/crm_models/account_response.go new file mode 100644 index 0000000..9bfe78c --- /dev/null +++ b/api/crm/crm_models/account_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AccountResponse An array of Account objects with Contacts +// +// swagger:model AccountResponse +type AccountResponse struct { + + // data + Data []*Account `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this account response +func (m *AccountResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AccountResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *AccountResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this account response based on the context it is used +func (m *AccountResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AccountResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *AccountResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *AccountResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AccountResponse) UnmarshalBinary(b []byte) error { + var res AccountResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/crm/crm_models/address.go b/api/crm/crm_models/address.go new file mode 100644 index 0000000..9dff52a --- /dev/null +++ b/api/crm/crm_models/address.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" +) + +// Address address +// +// swagger:model Address +type Address struct { + + // City + City string `json:"City,omitempty"` + + // Country full name + Country string `json:"Country,omitempty"` + + // Country Code + CountryCode string `json:"CountryCode,omitempty"` + + // Postal Code + PostalCode string `json:"PostalCode,omitempty"` + + // State full name + State string `json:"State,omitempty"` + + // State Code + StateCode string `json:"StateCode,omitempty"` + + // Street number and name + Street string `json:"Street,omitempty"` +} + +// Validate validates this address +func (m *Address) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this address based on context it is used +func (m *Address) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Address) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Address) UnmarshalBinary(b []byte) error { + var res Address + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/crm/crm_models/company.go b/api/crm/crm_models/company.go new file mode 100644 index 0000000..0d2f27c --- /dev/null +++ b/api/crm/crm_models/company.go @@ -0,0 +1,248 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" +) + +// Company company +// +// swagger:model Company +type Company struct { + + // Telnexus ID of the Account that owns this Company + AccountID string `json:"AccountID,omitempty"` + + // Account Number Prefix + AccountNumberPrefix string `json:"AccountNumberPrefix,omitempty"` + + // billing address + BillingAddress *Address `json:"BillingAddress,omitempty"` + + // Billing Advice + BillingAdvice string `json:"BillingAdvice,omitempty"` + + // Contact ID + BillingContactID string `json:"BillingContactID,omitempty"` + + // Billing Email + BillingEmail string `json:"BillingEmail,omitempty"` + + // Billing Phone + BillingPhone string `json:"BillingPhone,omitempty"` + + // Billing Website + BillingWebsite string `json:"BillingWebsite,omitempty"` + + // Chart of Accounts Template Account ID + COATemplateID string `json:"COATemplateID,omitempty"` + + // Color Accent1 + ColorAccent1 string `json:"ColorAccent1,omitempty"` + + // Color Accent2 + ColorAccent2 string `json:"ColorAccent2,omitempty"` + + // Color Primary + ColorPrimary string `json:"ColorPrimary,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // User ID of default Customer Success user + CustomerSuccessID string `json:"CustomerSuccessID,omitempty"` + + // Date Closed + DateClosed string `json:"DateClosed,omitempty"` + + // default address + DefaultAddress *Address `json:"DefaultAddress,omitempty"` + + // Default Company? + DefaultCompany bool `json:"DefaultCompany,omitempty"` + + // Font Name for Body Text + FontBody string `json:"FontBody,omitempty"` + + // Font Name for Heading + FontHeading string `json:"FontHeading,omitempty"` + + // Font Name for Heading Narrow + FontHeadingNarrow string `json:"FontHeadingNarrow,omitempty"` + + // Font Names for CSS Link + FontLink string `json:"FontLink,omitempty"` + + // Font Name for Monospace + FontMono string `json:"FontMono,omitempty"` + + // Telnexus Record Id + ID string `json:"ID,omitempty"` + + // International Customers? + International bool `json:"International,omitempty"` + + // Last Account Number + LastAccountNumber int64 `json:"LastAccountNumber,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Last TaxType Number + LastTaxTypeNumber int64 `json:"LastTaxTypeNumber,omitempty"` + + // Logo URL + Logo string `json:"Logo,omitempty"` + + // Company Name + Name string `json:"Name,omitempty"` + + // The ID of the contact who owns this Company + OwnerID string `json:"OwnerID,omitempty"` + + // User ID of the default tax preparer + PreparerID string `json:"PreparerID,omitempty"` + + // The ID of the default Pricebook for this company + PricebookID string `json:"PricebookID,omitempty"` + + // Tenant Identifier + TenantID string `json:"TenantID,omitempty"` + + // The ID of the contact who is the User Tech Lead for Company + UserTechLeadID string `json:"UserTechLeadID,omitempty"` +} + +// Validate validates this company +func (m *Company) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBillingAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDefaultAddress(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Company) validateBillingAddress(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("BillingAddress") + } + return err + } + } + + return nil +} + +func (m *Company) validateDefaultAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DefaultAddress) { // not required + return nil + } + + if m.DefaultAddress != nil { + if err := m.DefaultAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("DefaultAddress") + } + return err + } + } + + return nil +} + +// ContextValidate validate this company based on the context it is used +func (m *Company) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBillingAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDefaultAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Company) contextValidateBillingAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.BillingAddress != nil { + if err := m.BillingAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("BillingAddress") + } + return err + } + } + + return nil +} + +func (m *Company) contextValidateDefaultAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.DefaultAddress != nil { + if err := m.DefaultAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("DefaultAddress") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Company) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Company) UnmarshalBinary(b []byte) error { + var res Company + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/crm/crm_models/company_request.go b/api/crm/crm_models/company_request.go new file mode 100644 index 0000000..9fe8b6f --- /dev/null +++ b/api/crm/crm_models/company_request.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CompanyRequest An array of Company objects +// +// swagger:model CompanyRequest +type CompanyRequest struct { + + // data + Data []*Company `json:"Data"` +} + +// Validate validates this company request +func (m *CompanyRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CompanyRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this company request based on the context it is used +func (m *CompanyRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CompanyRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CompanyRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CompanyRequest) UnmarshalBinary(b []byte) error { + var res CompanyRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/crm/crm_models/company_response.go b/api/crm/crm_models/company_response.go new file mode 100644 index 0000000..2cbd2df --- /dev/null +++ b/api/crm/crm_models/company_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CompanyResponse An array of Company objects +// +// swagger:model CompanyResponse +type CompanyResponse struct { + + // data + Data []*Company `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this company response +func (m *CompanyResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CompanyResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CompanyResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this company response based on the context it is used +func (m *CompanyResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CompanyResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CompanyResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CompanyResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CompanyResponse) UnmarshalBinary(b []byte) error { + var res CompanyResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/crm/crm_models/contact.go b/api/crm/crm_models/contact.go new file mode 100644 index 0000000..f3ece63 --- /dev/null +++ b/api/crm/crm_models/contact.go @@ -0,0 +1,275 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" +) + +// Contact contact +// +// swagger:model Contact +type Contact struct { + + // The primary account ID of this contact + AccountID string `json:"AccountID,omitempty"` + + // Assistant Name + AssistantName string `json:"AssistantName,omitempty"` + + // Asst. Phone + AssistantPhone string `json:"AssistantPhone,omitempty"` + + // Birthdate + BirthDate string `json:"BirthDate,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Department + Department string `json:"Department,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // Do Not Call? + DoNotCall bool `json:"DoNotCall,omitempty"` + + // Email address + Email string `json:"Email,omitempty"` + + // Email Bounce Date + EmailBounceDate string `json:"EmailBounceDate,omitempty"` + + // Email Bounce Reason + EmailBouncedReason string `json:"EmailBouncedReason,omitempty"` + + // Telnexus Enrollment Status + EnrollmentStatus string `json:"EnrollmentStatus,omitempty"` + + // Fax Number + Fax string `json:"Fax,omitempty"` + + // First Name + FirstName string `json:"FirstName,omitempty"` + + // Email Opt Out + HasOptedOutOfEmail bool `json:"HasOptedOutOfEmail,omitempty"` + + // Fax Opt Out + HasOptedOutOfFax bool `json:"HasOptedOutOfFax,omitempty"` + + // Home Phone + HomePhone string `json:"HomePhone,omitempty"` + + // Telnexus Record Id + ID string `json:"ID,omitempty"` + + // Does this contact have bounced emails? + IsEmailBounced bool `json:"IsEmailBounced,omitempty"` + + // Is Provisioned? + IsProvisioned bool `json:"IsProvisioned,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Last Name + LastName string `json:"LastName,omitempty"` + + // Lead Source + LeadSource string `json:"LeadSource,omitempty"` + + // Level + Level string `json:"Level,omitempty"` + + // LinkedIn Page + LinkedIn string `json:"LinkedIn,omitempty"` + + // mailing address + MailingAddress *Address `json:"MailingAddress,omitempty"` + + // Mailing Lists + MailingLists string `json:"MailingLists,omitempty"` + + // Mobile Phone + MobilePhone string `json:"MobilePhone,omitempty"` + + // Full Name + Name string `json:"Name,omitempty"` + + // other address + OtherAddress *Address `json:"OtherAddress,omitempty"` + + // Other Phone + OtherPhone string `json:"OtherPhone,omitempty"` + + // The User ID of the user who owns this Contact + OwnerID string `json:"OwnerID,omitempty"` + + // Personal Email Address for this Contact + PersonalEmail string `json:"PersonalEmail,omitempty"` + + // Phone Number + Phone string `json:"Phone,omitempty"` + + // URL of a photograph of this User + PhotoURL string `json:"PhotoURL,omitempty"` + + // Recruiting Status + RecruitingStatus string `json:"RecruitingStatus,omitempty"` + + // External reference to this contact, if any + Ref string `json:"Ref,omitempty"` + + // Reports To Contact ID + ReportsToID string `json:"ReportsToID,omitempty"` + + // Contact Salutation + Salutation string `json:"Salutation,omitempty"` + + // The Contact Status + Status string `json:"Status,omitempty"` + + // Tenant Identifier + TenantID string `json:"TenantID,omitempty"` + + // Contact Title + Title string `json:"Title,omitempty"` + + // Contact Type + Type string `json:"Type,omitempty"` +} + +// Validate validates this contact +func (m *Contact) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMailingAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOtherAddress(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Contact) validateMailingAddress(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("MailingAddress") + } + return err + } + } + + return nil +} + +func (m *Contact) validateOtherAddress(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("OtherAddress") + } + return err + } + } + + return nil +} + +// ContextValidate validate this contact based on the context it is used +func (m *Contact) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMailingAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOtherAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Contact) contextValidateMailingAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.MailingAddress != nil { + if err := m.MailingAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("MailingAddress") + } + return err + } + } + + return nil +} + +func (m *Contact) contextValidateOtherAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.OtherAddress != nil { + if err := m.OtherAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("OtherAddress") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Contact) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Contact) UnmarshalBinary(b []byte) error { + var res Contact + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/crm/crm_models/contact_request.go b/api/crm/crm_models/contact_request.go new file mode 100644 index 0000000..51f2618 --- /dev/null +++ b/api/crm/crm_models/contact_request.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ContactRequest contact request +// +// swagger:model ContactRequest +type ContactRequest struct { + + // data + Data []*Contact `json:"Data"` +} + +// Validate validates this contact request +func (m *ContactRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ContactRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this contact request based on the context it is used +func (m *ContactRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ContactRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ContactRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ContactRequest) UnmarshalBinary(b []byte) error { + var res ContactRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/crm/crm_models/contact_response.go b/api/crm/crm_models/contact_response.go new file mode 100644 index 0000000..a9344f6 --- /dev/null +++ b/api/crm/crm_models/contact_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ContactResponse contact response +// +// swagger:model ContactResponse +type ContactResponse struct { + + // data + Data []*Contact `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this contact response +func (m *ContactResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ContactResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ContactResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this contact response based on the context it is used +func (m *ContactResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ContactResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ContactResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ContactResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ContactResponse) UnmarshalBinary(b []byte) error { + var res ContactResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/crm/crm_models/delete_response.go b/api/crm/crm_models/delete_response.go new file mode 100644 index 0000000..1a2fe07 --- /dev/null +++ b/api/crm/crm_models/delete_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DeleteResponse delete response +// +// swagger:model DeleteResponse +type DeleteResponse struct { + + // data + Data []*Message `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this delete response +func (m *DeleteResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeleteResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DeleteResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this delete response based on the context it is used +func (m *DeleteResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeleteResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DeleteResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeleteResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeleteResponse) UnmarshalBinary(b []byte) error { + var res DeleteResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/crm/crm_models/error.go b/api/crm/crm_models/error.go new file mode 100644 index 0000000..8374e31 --- /dev/null +++ b/api/crm/crm_models/error.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" +) + +// Error error +// +// swagger:model Error +type Error struct { + + // code + Code int64 `json:"Code,omitempty"` + + // fields + Fields string `json:"Fields,omitempty"` + + // message + Message string `json:"Message,omitempty"` +} + +// Validate validates this error +func (m *Error) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this error based on context it is used +func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Error) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Error) UnmarshalBinary(b []byte) error { + var res Error + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/crm/crm_models/invalid_error.go b/api/crm/crm_models/invalid_error.go new file mode 100644 index 0000000..17a77c2 --- /dev/null +++ b/api/crm/crm_models/invalid_error.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" +) + +// InvalidError invalid error +// +// swagger:model InvalidError +type InvalidError struct { + Error + + // details + Details []string `json:"details"` +} + +// UnmarshalJSON unmarshals this object from a JSON structure +func (m *InvalidError) UnmarshalJSON(raw []byte) error { + // AO0 + var aO0 Error + if err := swag.ReadJSON(raw, &aO0); err != nil { + return err + } + m.Error = aO0 + + // AO1 + var dataAO1 struct { + Details []string `json:"details"` + } + if err := swag.ReadJSON(raw, &dataAO1); err != nil { + return err + } + + m.Details = dataAO1.Details + + return nil +} + +// MarshalJSON marshals this object to a JSON structure +func (m InvalidError) MarshalJSON() ([]byte, error) { + _parts := make([][]byte, 0, 2) + + aO0, err := swag.WriteJSON(m.Error) + if err != nil { + return nil, err + } + _parts = append(_parts, aO0) + var dataAO1 struct { + Details []string `json:"details"` + } + + dataAO1.Details = m.Details + + jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) + if errAO1 != nil { + return nil, errAO1 + } + _parts = append(_parts, jsonDataAO1) + return swag.ConcatJSON(_parts...), nil +} + +// Validate validates this invalid error +func (m *InvalidError) Validate(formats strfmt.Registry) error { + var res []error + + // validation for a type composition with Error + if err := m.Error.Validate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this invalid error based on the context it is used +func (m *InvalidError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + // validation for a type composition with Error + if err := m.Error.ContextValidate(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// MarshalBinary interface implementation +func (m *InvalidError) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InvalidError) UnmarshalBinary(b []byte) error { + var res InvalidError + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/crm/crm_models/lead.go b/api/crm/crm_models/lead.go new file mode 100644 index 0000000..80c8916 --- /dev/null +++ b/api/crm/crm_models/lead.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" +) + +// Lead lead +// +// swagger:model Lead +type Lead struct { + + // address + Address *Address `json:"Address,omitempty"` + + // Company + Company string `json:"Company,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // Email + Email string `json:"Email,omitempty"` + + // First Name + FirstName string `json:"FirstName,omitempty"` + + // Telnexus Record Id + ID string `json:"ID,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Last Name + LastName string `json:"LastName,omitempty"` + + // Mobile + MobilePhone string `json:"MobilePhone,omitempty"` + + // Name + Name string `json:"Name,omitempty"` + + // LeadBasic Owner + OwnerID string `json:"OwnerId,omitempty"` + + // Partner Account + PartnerAccountID string `json:"PartnerAccountId,omitempty"` + + // Phone + Phone string `json:"Phone,omitempty"` + + // Product + ProductID string `json:"ProductID,omitempty"` + + // referer_url + RefererURL string `json:"RefererURL,omitempty"` + + // LeadBasic Status + Status string `json:"Status,omitempty"` + + // Tenant Identifier + TenantID string `json:"TenantID,omitempty"` + + // Title + Title string `json:"Title,omitempty"` + + // Type + Type string `json:"Type,omitempty"` + + // utm_campaign + UTMCampaign string `json:"UTMCampaign,omitempty"` + + // utm_content + UTMContent string `json:"UTMContent,omitempty"` + + // utm_medium + UTMMedium string `json:"UTMMedium,omitempty"` + + // utm_source + UTMSource string `json:"UTMSource,omitempty"` + + // utm_term + UTMTerm string `json:"UTMTerm,omitempty"` + + // Website + Website string `json:"Website,omitempty"` +} + +// Validate validates this lead +func (m *Lead) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Lead) validateAddress(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Address") + } + return err + } + } + + return nil +} + +// ContextValidate validate this lead based on the context it is used +func (m *Lead) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Lead) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.Address != nil { + if err := m.Address.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Address") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Lead) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Lead) UnmarshalBinary(b []byte) error { + var res Lead + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/crm/crm_models/lead_request.go b/api/crm/crm_models/lead_request.go new file mode 100644 index 0000000..052cbf6 --- /dev/null +++ b/api/crm/crm_models/lead_request.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// LeadRequest lead request +// +// swagger:model LeadRequest +type LeadRequest struct { + + // data + Data []*Lead `json:"Data"` +} + +// Validate validates this lead request +func (m *LeadRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *LeadRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this lead request based on the context it is used +func (m *LeadRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *LeadRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *LeadRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LeadRequest) UnmarshalBinary(b []byte) error { + var res LeadRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/crm/crm_models/lead_response.go b/api/crm/crm_models/lead_response.go new file mode 100644 index 0000000..26467bb --- /dev/null +++ b/api/crm/crm_models/lead_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// LeadResponse lead response +// +// swagger:model LeadResponse +type LeadResponse struct { + + // data + Data []*Lead `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this lead response +func (m *LeadResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *LeadResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *LeadResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this lead response based on the context it is used +func (m *LeadResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *LeadResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *LeadResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *LeadResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LeadResponse) UnmarshalBinary(b []byte) error { + var res LeadResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/crm/crm_models/message.go b/api/crm/crm_models/message.go new file mode 100644 index 0000000..1c9aac5 --- /dev/null +++ b/api/crm/crm_models/message.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" +) + +// Message message +// +// swagger:model Message +type Message struct { + + // message + Message string `json:"message,omitempty"` + + // ref + Ref string `json:"ref,omitempty"` + + // status + Status int64 `json:"status,omitempty"` +} + +// Validate validates this message +func (m *Message) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this message based on context it is used +func (m *Message) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Message) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Message) UnmarshalBinary(b []byte) error { + var res Message + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/crm/crm_models/pagination.go b/api/crm/crm_models/pagination.go new file mode 100644 index 0000000..3a7c567 --- /dev/null +++ b/api/crm/crm_models/pagination.go @@ -0,0 +1,63 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" +) + +// Pagination pagination +// +// swagger:model Pagination +type Pagination struct { + + // limit + Limit int64 `json:"limit,omitempty"` + + // pagesize + Pagesize int64 `json:"pagesize,omitempty"` + + // poffset + Poffset int64 `json:"poffset,omitempty"` + + // setsize + Setsize int64 `json:"setsize,omitempty"` +} + +// Validate validates this pagination +func (m *Pagination) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this pagination based on context it is used +func (m *Pagination) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Pagination) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Pagination) UnmarshalBinary(b []byte) error { + var res Pagination + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/crm/crm_models/request_meta.go b/api/crm/crm_models/request_meta.go new file mode 100644 index 0000000..e0d98b0 --- /dev/null +++ b/api/crm/crm_models/request_meta.go @@ -0,0 +1,75 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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/validate" +) + +// RequestMeta request meta +// +// swagger:model RequestMeta +type RequestMeta struct { + + // Telnexus Account Number of the Reseller or OEM + // Required: true + TelnexusAccount *string `json:"TelnexusAccount"` +} + +// Validate validates this request meta +func (m *RequestMeta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTelnexusAccount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RequestMeta) validateTelnexusAccount(formats strfmt.Registry) error { + + if err := validate.Required("TelnexusAccount", "body", m.TelnexusAccount); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this request meta based on context it is used +func (m *RequestMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RequestMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RequestMeta) UnmarshalBinary(b []byte) error { + var res RequestMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/crm/crm_models/response_meta.go b/api/crm/crm_models/response_meta.go new file mode 100644 index 0000000..d63fc08 --- /dev/null +++ b/api/crm/crm_models/response_meta.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" +) + +// ResponseMeta response meta +// +// swagger:model ResponseMeta +type ResponseMeta struct { + + // Microservice Contact Info + Contact string `json:"Contact,omitempty"` + + // Copyright Info + Copyright string `json:"Copyright,omitempty"` + + // License Information and Restrictions + License string `json:"License,omitempty"` + + // Operation ID + OperationID string `json:"OperationID,omitempty"` + + // pagination + Pagination *Pagination `json:"Pagination,omitempty"` + + // Request IP Address + RequestIP string `json:"RequestIP,omitempty"` + + // Request Type + RequestType string `json:"RequestType,omitempty"` + + // Request URL + RequestURL string `json:"RequestURL,omitempty"` + + // Data Server Info + ServerInfo string `json:"ServerInfo,omitempty"` + + // Data Server Response Time (ms) + ServerResponseTime string `json:"ServerResponseTime,omitempty"` + + // Backend Server Timestamp + ServerTimestamp string `json:"ServerTimestamp,omitempty"` + + // Telnexus Account Number used for recording transactions + TelnexusAccount string `json:"TelnexusAccount,omitempty"` +} + +// Validate validates this response meta +func (m *ResponseMeta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePagination(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ResponseMeta) validatePagination(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Pagination") + } + return err + } + } + + return nil +} + +// ContextValidate validate this response meta based on the context it is used +func (m *ResponseMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePagination(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ResponseMeta) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { + + if m.Pagination != nil { + if err := m.Pagination.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Pagination") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ResponseMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ResponseMeta) UnmarshalBinary(b []byte) error { + var res ResponseMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_client/cluster/cluster_client.go b/api/devops/devops_client/cluster/cluster_client.go new file mode 100644 index 0000000..bd906c5 --- /dev/null +++ b/api/devops/devops_client/cluster/cluster_client.go @@ -0,0 +1,258 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cluster + +// 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 cluster API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for cluster 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 { + GetCluster(params *GetClusterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetClusterOK, error) + + GetClusters(params *GetClustersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetClustersOK, error) + + GetClustersObservable(params *GetClustersObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetClustersObservableOK, error) + + PostClusters(params *PostClustersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostClustersOK, error) + + PutClusters(params *PutClustersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutClustersOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetCluster gets a single cluster object + + Return a single Cluster object from datastore as a Singleton +*/ +func (a *Client) GetCluster(params *GetClusterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetClusterOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClusterParams() + } + op := &runtime.ClientOperation{ + ID: "getCluster", + Method: "GET", + PathPattern: "/clusters/{clusterIdPath}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetClusterReader{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.(*GetClusterOK) + 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 getCluster: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetClusters gets a list clusters + + Return a list of Cluster records from the datastore +*/ +func (a *Client) GetClusters(params *GetClustersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetClustersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClustersParams() + } + op := &runtime.ClientOperation{ + ID: "getClusters", + Method: "GET", + PathPattern: "/clusters", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetClustersReader{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.(*GetClustersOK) + 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 getClusters: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetClustersObservable gets clusters in an observable array + + Returns a Cluster retrieval in a observable array +*/ +func (a *Client) GetClustersObservable(params *GetClustersObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetClustersObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClustersObservableParams() + } + op := &runtime.ClientOperation{ + ID: "getClustersObservable", + Method: "GET", + PathPattern: "/clusters/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetClustersObservableReader{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.(*GetClustersObservableOK) + 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 getClustersObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostClusters creates new clusters + + Create Clusters in Telnexus +*/ +func (a *Client) PostClusters(params *PostClustersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostClustersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostClustersParams() + } + op := &runtime.ClientOperation{ + ID: "postClusters", + Method: "POST", + PathPattern: "/clusters", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostClustersReader{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.(*PostClustersOK) + 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 postClusters: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutClusters updates clustera + + Update Cluster in Telnexus +*/ +func (a *Client) PutClusters(params *PutClustersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutClustersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutClustersParams() + } + op := &runtime.ClientOperation{ + ID: "putClusters", + Method: "PUT", + PathPattern: "/clusters", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutClustersReader{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.(*PutClustersOK) + 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 putClusters: 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 +} diff --git a/api/devops/devops_client/cluster/get_cluster_parameters.go b/api/devops/devops_client/cluster/get_cluster_parameters.go new file mode 100644 index 0000000..4aa7863 --- /dev/null +++ b/api/devops/devops_client/cluster/get_cluster_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cluster + +// 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" +) + +// NewGetClusterParams creates a new GetClusterParams 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 NewGetClusterParams() *GetClusterParams { + return &GetClusterParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetClusterParamsWithTimeout creates a new GetClusterParams object +// with the ability to set a timeout on a request. +func NewGetClusterParamsWithTimeout(timeout time.Duration) *GetClusterParams { + return &GetClusterParams{ + timeout: timeout, + } +} + +// NewGetClusterParamsWithContext creates a new GetClusterParams object +// with the ability to set a context for a request. +func NewGetClusterParamsWithContext(ctx context.Context) *GetClusterParams { + return &GetClusterParams{ + Context: ctx, + } +} + +// NewGetClusterParamsWithHTTPClient creates a new GetClusterParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetClusterParamsWithHTTPClient(client *http.Client) *GetClusterParams { + return &GetClusterParams{ + HTTPClient: client, + } +} + +/* GetClusterParams contains all the parameters to send to the API endpoint + for the get cluster operation. + + Typically these are written to a http.Request. +*/ +type GetClusterParams struct { + + /* ClusterIDPath. + + Telnexus Record Id of a Cluster + */ + ClusterIDPath string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetClusterParams) WithDefaults() *GetClusterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetClusterParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get cluster params +func (o *GetClusterParams) WithTimeout(timeout time.Duration) *GetClusterParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cluster params +func (o *GetClusterParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cluster params +func (o *GetClusterParams) WithContext(ctx context.Context) *GetClusterParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cluster params +func (o *GetClusterParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cluster params +func (o *GetClusterParams) WithHTTPClient(client *http.Client) *GetClusterParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cluster params +func (o *GetClusterParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterIDPath adds the clusterIDPath to the get cluster params +func (o *GetClusterParams) WithClusterIDPath(clusterIDPath string) *GetClusterParams { + o.SetClusterIDPath(clusterIDPath) + return o +} + +// SetClusterIDPath adds the clusterIdPath to the get cluster params +func (o *GetClusterParams) SetClusterIDPath(clusterIDPath string) { + o.ClusterIDPath = clusterIDPath +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClusterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param clusterIdPath + if err := r.SetPathParam("clusterIdPath", o.ClusterIDPath); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/cluster/get_cluster_responses.go b/api/devops/devops_client/cluster/get_cluster_responses.go new file mode 100644 index 0000000..feb08b8 --- /dev/null +++ b/api/devops/devops_client/cluster/get_cluster_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cluster + +// 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/telnexus/lib/api/devops/devops_models" +) + +// GetClusterReader is a Reader for the GetCluster structure. +type GetClusterReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClusterOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetClusterUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetClusterForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetClusterNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetClusterUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetClusterInternalServerError() + 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()) + } +} + +// NewGetClusterOK creates a GetClusterOK with default headers values +func NewGetClusterOK() *GetClusterOK { + return &GetClusterOK{} +} + +/* GetClusterOK describes a response with status code 200, with default header values. + +Single Cluster record response +*/ +type GetClusterOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Cluster +} + +func (o *GetClusterOK) Error() string { + return fmt.Sprintf("[GET /clusters/{clusterIdPath}][%d] getClusterOK %+v", 200, o.Payload) +} +func (o *GetClusterOK) GetPayload() *devops_models.Cluster { + return o.Payload +} + +func (o *GetClusterOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Cluster) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClusterUnauthorized creates a GetClusterUnauthorized with default headers values +func NewGetClusterUnauthorized() *GetClusterUnauthorized { + return &GetClusterUnauthorized{} +} + +/* GetClusterUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetClusterUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetClusterUnauthorized) Error() string { + return fmt.Sprintf("[GET /clusters/{clusterIdPath}][%d] getClusterUnauthorized %+v", 401, o.Payload) +} +func (o *GetClusterUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetClusterUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClusterForbidden creates a GetClusterForbidden with default headers values +func NewGetClusterForbidden() *GetClusterForbidden { + return &GetClusterForbidden{} +} + +/* GetClusterForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetClusterForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetClusterForbidden) Error() string { + return fmt.Sprintf("[GET /clusters/{clusterIdPath}][%d] getClusterForbidden %+v", 403, o.Payload) +} +func (o *GetClusterForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetClusterForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClusterNotFound creates a GetClusterNotFound with default headers values +func NewGetClusterNotFound() *GetClusterNotFound { + return &GetClusterNotFound{} +} + +/* GetClusterNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetClusterNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetClusterNotFound) Error() string { + return fmt.Sprintf("[GET /clusters/{clusterIdPath}][%d] getClusterNotFound %+v", 404, o.Payload) +} +func (o *GetClusterNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetClusterNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClusterUnprocessableEntity creates a GetClusterUnprocessableEntity with default headers values +func NewGetClusterUnprocessableEntity() *GetClusterUnprocessableEntity { + return &GetClusterUnprocessableEntity{} +} + +/* GetClusterUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetClusterUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetClusterUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /clusters/{clusterIdPath}][%d] getClusterUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetClusterUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetClusterUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClusterInternalServerError creates a GetClusterInternalServerError with default headers values +func NewGetClusterInternalServerError() *GetClusterInternalServerError { + return &GetClusterInternalServerError{} +} + +/* GetClusterInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetClusterInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetClusterInternalServerError) Error() string { + return fmt.Sprintf("[GET /clusters/{clusterIdPath}][%d] getClusterInternalServerError %+v", 500, o.Payload) +} +func (o *GetClusterInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetClusterInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/cluster/get_clusters_observable_parameters.go b/api/devops/devops_client/cluster/get_clusters_observable_parameters.go new file mode 100644 index 0000000..1b3f62a --- /dev/null +++ b/api/devops/devops_client/cluster/get_clusters_observable_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cluster + +// 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" +) + +// NewGetClustersObservableParams creates a new GetClustersObservableParams 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 NewGetClustersObservableParams() *GetClustersObservableParams { + return &GetClustersObservableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetClustersObservableParamsWithTimeout creates a new GetClustersObservableParams object +// with the ability to set a timeout on a request. +func NewGetClustersObservableParamsWithTimeout(timeout time.Duration) *GetClustersObservableParams { + return &GetClustersObservableParams{ + timeout: timeout, + } +} + +// NewGetClustersObservableParamsWithContext creates a new GetClustersObservableParams object +// with the ability to set a context for a request. +func NewGetClustersObservableParamsWithContext(ctx context.Context) *GetClustersObservableParams { + return &GetClustersObservableParams{ + Context: ctx, + } +} + +// NewGetClustersObservableParamsWithHTTPClient creates a new GetClustersObservableParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetClustersObservableParamsWithHTTPClient(client *http.Client) *GetClustersObservableParams { + return &GetClustersObservableParams{ + HTTPClient: client, + } +} + +/* GetClustersObservableParams contains all the parameters to send to the API endpoint + for the get clusters observable operation. + + Typically these are written to a http.Request. +*/ +type GetClustersObservableParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get clusters observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetClustersObservableParams) WithDefaults() *GetClustersObservableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get clusters observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetClustersObservableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get clusters observable params +func (o *GetClustersObservableParams) WithTimeout(timeout time.Duration) *GetClustersObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get clusters observable params +func (o *GetClustersObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get clusters observable params +func (o *GetClustersObservableParams) WithContext(ctx context.Context) *GetClustersObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get clusters observable params +func (o *GetClustersObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get clusters observable params +func (o *GetClustersObservableParams) WithHTTPClient(client *http.Client) *GetClustersObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get clusters observable params +func (o *GetClustersObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClustersObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/cluster/get_clusters_observable_responses.go b/api/devops/devops_client/cluster/get_clusters_observable_responses.go new file mode 100644 index 0000000..4dabf07 --- /dev/null +++ b/api/devops/devops_client/cluster/get_clusters_observable_responses.go @@ -0,0 +1,337 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cluster + +// 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/telnexus/lib/api/devops/devops_models" +) + +// GetClustersObservableReader is a Reader for the GetClustersObservable structure. +type GetClustersObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClustersObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClustersObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetClustersObservableUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetClustersObservableForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetClustersObservableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetClustersObservableUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetClustersObservableInternalServerError() + 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()) + } +} + +// NewGetClustersObservableOK creates a GetClustersObservableOK with default headers values +func NewGetClustersObservableOK() *GetClustersObservableOK { + return &GetClustersObservableOK{} +} + +/* GetClustersObservableOK describes a response with status code 200, with default header values. + +Single Cluster record response +*/ +type GetClustersObservableOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload []*devops_models.Cluster +} + +func (o *GetClustersObservableOK) Error() string { + return fmt.Sprintf("[GET /clusters/observable][%d] getClustersObservableOK %+v", 200, o.Payload) +} +func (o *GetClustersObservableOK) GetPayload() []*devops_models.Cluster { + return o.Payload +} + +func (o *GetClustersObservableOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClustersObservableUnauthorized creates a GetClustersObservableUnauthorized with default headers values +func NewGetClustersObservableUnauthorized() *GetClustersObservableUnauthorized { + return &GetClustersObservableUnauthorized{} +} + +/* GetClustersObservableUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetClustersObservableUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetClustersObservableUnauthorized) Error() string { + return fmt.Sprintf("[GET /clusters/observable][%d] getClustersObservableUnauthorized %+v", 401, o.Payload) +} +func (o *GetClustersObservableUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetClustersObservableUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClustersObservableForbidden creates a GetClustersObservableForbidden with default headers values +func NewGetClustersObservableForbidden() *GetClustersObservableForbidden { + return &GetClustersObservableForbidden{} +} + +/* GetClustersObservableForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetClustersObservableForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetClustersObservableForbidden) Error() string { + return fmt.Sprintf("[GET /clusters/observable][%d] getClustersObservableForbidden %+v", 403, o.Payload) +} +func (o *GetClustersObservableForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetClustersObservableForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClustersObservableNotFound creates a GetClustersObservableNotFound with default headers values +func NewGetClustersObservableNotFound() *GetClustersObservableNotFound { + return &GetClustersObservableNotFound{} +} + +/* GetClustersObservableNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetClustersObservableNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetClustersObservableNotFound) Error() string { + return fmt.Sprintf("[GET /clusters/observable][%d] getClustersObservableNotFound %+v", 404, o.Payload) +} +func (o *GetClustersObservableNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetClustersObservableNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClustersObservableUnprocessableEntity creates a GetClustersObservableUnprocessableEntity with default headers values +func NewGetClustersObservableUnprocessableEntity() *GetClustersObservableUnprocessableEntity { + return &GetClustersObservableUnprocessableEntity{} +} + +/* GetClustersObservableUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetClustersObservableUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetClustersObservableUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /clusters/observable][%d] getClustersObservableUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetClustersObservableUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetClustersObservableUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClustersObservableInternalServerError creates a GetClustersObservableInternalServerError with default headers values +func NewGetClustersObservableInternalServerError() *GetClustersObservableInternalServerError { + return &GetClustersObservableInternalServerError{} +} + +/* GetClustersObservableInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetClustersObservableInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetClustersObservableInternalServerError) Error() string { + return fmt.Sprintf("[GET /clusters/observable][%d] getClustersObservableInternalServerError %+v", 500, o.Payload) +} +func (o *GetClustersObservableInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetClustersObservableInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/cluster/get_clusters_parameters.go b/api/devops/devops_client/cluster/get_clusters_parameters.go new file mode 100644 index 0000000..2e6f4c3 --- /dev/null +++ b/api/devops/devops_client/cluster/get_clusters_parameters.go @@ -0,0 +1,272 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cluster + +// 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" +) + +// NewGetClustersParams creates a new GetClustersParams 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 NewGetClustersParams() *GetClustersParams { + return &GetClustersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetClustersParamsWithTimeout creates a new GetClustersParams object +// with the ability to set a timeout on a request. +func NewGetClustersParamsWithTimeout(timeout time.Duration) *GetClustersParams { + return &GetClustersParams{ + timeout: timeout, + } +} + +// NewGetClustersParamsWithContext creates a new GetClustersParams object +// with the ability to set a context for a request. +func NewGetClustersParamsWithContext(ctx context.Context) *GetClustersParams { + return &GetClustersParams{ + Context: ctx, + } +} + +// NewGetClustersParamsWithHTTPClient creates a new GetClustersParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetClustersParamsWithHTTPClient(client *http.Client) *GetClustersParams { + return &GetClustersParams{ + HTTPClient: client, + } +} + +/* GetClustersParams contains all the parameters to send to the API endpoint + for the get clusters operation. + + Typically these are written to a http.Request. +*/ +type GetClustersParams struct { + + /* ClusterID. + + Telnexus Record Id of a Cluster + */ + ClusterID *string + + /* CompanyID. + + Telnexus Record Id of a Company + */ + CompanyID *string + + /* Limit. + + How many objects to return at one time + + Format: int64 + */ + Limit *int64 + + /* Offset. + + How many objects to skip? (default 0) + + Format: int64 + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get clusters params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetClustersParams) WithDefaults() *GetClustersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get clusters params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetClustersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get clusters params +func (o *GetClustersParams) WithTimeout(timeout time.Duration) *GetClustersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get clusters params +func (o *GetClustersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get clusters params +func (o *GetClustersParams) WithContext(ctx context.Context) *GetClustersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get clusters params +func (o *GetClustersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get clusters params +func (o *GetClustersParams) WithHTTPClient(client *http.Client) *GetClustersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get clusters params +func (o *GetClustersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get clusters params +func (o *GetClustersParams) WithClusterID(clusterID *string) *GetClustersParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get clusters params +func (o *GetClustersParams) SetClusterID(clusterID *string) { + o.ClusterID = clusterID +} + +// WithCompanyID adds the companyID to the get clusters params +func (o *GetClustersParams) WithCompanyID(companyID *string) *GetClustersParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get clusters params +func (o *GetClustersParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WithLimit adds the limit to the get clusters params +func (o *GetClustersParams) WithLimit(limit *int64) *GetClustersParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get clusters params +func (o *GetClustersParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get clusters params +func (o *GetClustersParams) WithOffset(offset *int64) *GetClustersParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get clusters params +func (o *GetClustersParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClustersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ClusterID != nil { + + // query param clusterId + var qrClusterID string + + if o.ClusterID != nil { + qrClusterID = *o.ClusterID + } + qClusterID := qrClusterID + if qClusterID != "" { + + if err := r.SetQueryParam("clusterId", qClusterID); err != nil { + return err + } + } + } + + if o.CompanyID != nil { + + // query param companyId + var qrCompanyID string + + if o.CompanyID != nil { + qrCompanyID = *o.CompanyID + } + qCompanyID := qrCompanyID + if qCompanyID != "" { + + if err := r.SetQueryParam("companyId", qCompanyID); 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 +} diff --git a/api/devops/devops_client/cluster/get_clusters_responses.go b/api/devops/devops_client/cluster/get_clusters_responses.go new file mode 100644 index 0000000..7f4c3bf --- /dev/null +++ b/api/devops/devops_client/cluster/get_clusters_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cluster + +// 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/telnexus/lib/api/devops/devops_models" +) + +// GetClustersReader is a Reader for the GetClusters structure. +type GetClustersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClustersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClustersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetClustersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetClustersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetClustersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetClustersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetClustersInternalServerError() + 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()) + } +} + +// NewGetClustersOK creates a GetClustersOK with default headers values +func NewGetClustersOK() *GetClustersOK { + return &GetClustersOK{} +} + +/* GetClustersOK describes a response with status code 200, with default header values. + +Telnexus Response with Cluster objects +*/ +type GetClustersOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.ClusterResponse +} + +func (o *GetClustersOK) Error() string { + return fmt.Sprintf("[GET /clusters][%d] getClustersOK %+v", 200, o.Payload) +} +func (o *GetClustersOK) GetPayload() *devops_models.ClusterResponse { + return o.Payload +} + +func (o *GetClustersOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.ClusterResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClustersUnauthorized creates a GetClustersUnauthorized with default headers values +func NewGetClustersUnauthorized() *GetClustersUnauthorized { + return &GetClustersUnauthorized{} +} + +/* GetClustersUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetClustersUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetClustersUnauthorized) Error() string { + return fmt.Sprintf("[GET /clusters][%d] getClustersUnauthorized %+v", 401, o.Payload) +} +func (o *GetClustersUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetClustersUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClustersForbidden creates a GetClustersForbidden with default headers values +func NewGetClustersForbidden() *GetClustersForbidden { + return &GetClustersForbidden{} +} + +/* GetClustersForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetClustersForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetClustersForbidden) Error() string { + return fmt.Sprintf("[GET /clusters][%d] getClustersForbidden %+v", 403, o.Payload) +} +func (o *GetClustersForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetClustersForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClustersNotFound creates a GetClustersNotFound with default headers values +func NewGetClustersNotFound() *GetClustersNotFound { + return &GetClustersNotFound{} +} + +/* GetClustersNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetClustersNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetClustersNotFound) Error() string { + return fmt.Sprintf("[GET /clusters][%d] getClustersNotFound %+v", 404, o.Payload) +} +func (o *GetClustersNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetClustersNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClustersUnprocessableEntity creates a GetClustersUnprocessableEntity with default headers values +func NewGetClustersUnprocessableEntity() *GetClustersUnprocessableEntity { + return &GetClustersUnprocessableEntity{} +} + +/* GetClustersUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetClustersUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetClustersUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /clusters][%d] getClustersUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetClustersUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetClustersUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClustersInternalServerError creates a GetClustersInternalServerError with default headers values +func NewGetClustersInternalServerError() *GetClustersInternalServerError { + return &GetClustersInternalServerError{} +} + +/* GetClustersInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetClustersInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetClustersInternalServerError) Error() string { + return fmt.Sprintf("[GET /clusters][%d] getClustersInternalServerError %+v", 500, o.Payload) +} +func (o *GetClustersInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetClustersInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/cluster/post_clusters_parameters.go b/api/devops/devops_client/cluster/post_clusters_parameters.go new file mode 100644 index 0000000..d7dd4c6 --- /dev/null +++ b/api/devops/devops_client/cluster/post_clusters_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cluster + +// 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/telnexus/lib/api/devops/devops_models" +) + +// NewPostClustersParams creates a new PostClustersParams 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 NewPostClustersParams() *PostClustersParams { + return &PostClustersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostClustersParamsWithTimeout creates a new PostClustersParams object +// with the ability to set a timeout on a request. +func NewPostClustersParamsWithTimeout(timeout time.Duration) *PostClustersParams { + return &PostClustersParams{ + timeout: timeout, + } +} + +// NewPostClustersParamsWithContext creates a new PostClustersParams object +// with the ability to set a context for a request. +func NewPostClustersParamsWithContext(ctx context.Context) *PostClustersParams { + return &PostClustersParams{ + Context: ctx, + } +} + +// NewPostClustersParamsWithHTTPClient creates a new PostClustersParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostClustersParamsWithHTTPClient(client *http.Client) *PostClustersParams { + return &PostClustersParams{ + HTTPClient: client, + } +} + +/* PostClustersParams contains all the parameters to send to the API endpoint + for the post clusters operation. + + Typically these are written to a http.Request. +*/ +type PostClustersParams struct { + + /* ClusterRequest. + + An array of Cluster records + */ + ClusterRequest *devops_models.ClusterRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post clusters params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostClustersParams) WithDefaults() *PostClustersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post clusters params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostClustersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post clusters params +func (o *PostClustersParams) WithTimeout(timeout time.Duration) *PostClustersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post clusters params +func (o *PostClustersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post clusters params +func (o *PostClustersParams) WithContext(ctx context.Context) *PostClustersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post clusters params +func (o *PostClustersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post clusters params +func (o *PostClustersParams) WithHTTPClient(client *http.Client) *PostClustersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post clusters params +func (o *PostClustersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterRequest adds the clusterRequest to the post clusters params +func (o *PostClustersParams) WithClusterRequest(clusterRequest *devops_models.ClusterRequest) *PostClustersParams { + o.SetClusterRequest(clusterRequest) + return o +} + +// SetClusterRequest adds the clusterRequest to the post clusters params +func (o *PostClustersParams) SetClusterRequest(clusterRequest *devops_models.ClusterRequest) { + o.ClusterRequest = clusterRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostClustersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.ClusterRequest != nil { + if err := r.SetBodyParam(o.ClusterRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/cluster/post_clusters_responses.go b/api/devops/devops_client/cluster/post_clusters_responses.go new file mode 100644 index 0000000..27823d8 --- /dev/null +++ b/api/devops/devops_client/cluster/post_clusters_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cluster + +// 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/telnexus/lib/api/devops/devops_models" +) + +// PostClustersReader is a Reader for the PostClusters structure. +type PostClustersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostClustersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostClustersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostClustersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostClustersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostClustersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostClustersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostClustersInternalServerError() + 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()) + } +} + +// NewPostClustersOK creates a PostClustersOK with default headers values +func NewPostClustersOK() *PostClustersOK { + return &PostClustersOK{} +} + +/* PostClustersOK describes a response with status code 200, with default header values. + +Telnexus Response with Cluster objects +*/ +type PostClustersOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.ClusterResponse +} + +func (o *PostClustersOK) Error() string { + return fmt.Sprintf("[POST /clusters][%d] postClustersOK %+v", 200, o.Payload) +} +func (o *PostClustersOK) GetPayload() *devops_models.ClusterResponse { + return o.Payload +} + +func (o *PostClustersOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.ClusterResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostClustersUnauthorized creates a PostClustersUnauthorized with default headers values +func NewPostClustersUnauthorized() *PostClustersUnauthorized { + return &PostClustersUnauthorized{} +} + +/* PostClustersUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostClustersUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PostClustersUnauthorized) Error() string { + return fmt.Sprintf("[POST /clusters][%d] postClustersUnauthorized %+v", 401, o.Payload) +} +func (o *PostClustersUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostClustersUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostClustersForbidden creates a PostClustersForbidden with default headers values +func NewPostClustersForbidden() *PostClustersForbidden { + return &PostClustersForbidden{} +} + +/* PostClustersForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostClustersForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostClustersForbidden) Error() string { + return fmt.Sprintf("[POST /clusters][%d] postClustersForbidden %+v", 403, o.Payload) +} +func (o *PostClustersForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostClustersForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostClustersNotFound creates a PostClustersNotFound with default headers values +func NewPostClustersNotFound() *PostClustersNotFound { + return &PostClustersNotFound{} +} + +/* PostClustersNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostClustersNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostClustersNotFound) Error() string { + return fmt.Sprintf("[POST /clusters][%d] postClustersNotFound %+v", 404, o.Payload) +} +func (o *PostClustersNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostClustersNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostClustersUnprocessableEntity creates a PostClustersUnprocessableEntity with default headers values +func NewPostClustersUnprocessableEntity() *PostClustersUnprocessableEntity { + return &PostClustersUnprocessableEntity{} +} + +/* PostClustersUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostClustersUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PostClustersUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /clusters][%d] postClustersUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PostClustersUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostClustersUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostClustersInternalServerError creates a PostClustersInternalServerError with default headers values +func NewPostClustersInternalServerError() *PostClustersInternalServerError { + return &PostClustersInternalServerError{} +} + +/* PostClustersInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostClustersInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostClustersInternalServerError) Error() string { + return fmt.Sprintf("[POST /clusters][%d] postClustersInternalServerError %+v", 500, o.Payload) +} +func (o *PostClustersInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostClustersInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/cluster/put_clusters_parameters.go b/api/devops/devops_client/cluster/put_clusters_parameters.go new file mode 100644 index 0000000..d4b57f0 --- /dev/null +++ b/api/devops/devops_client/cluster/put_clusters_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cluster + +// 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/telnexus/lib/api/devops/devops_models" +) + +// NewPutClustersParams creates a new PutClustersParams 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 NewPutClustersParams() *PutClustersParams { + return &PutClustersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPutClustersParamsWithTimeout creates a new PutClustersParams object +// with the ability to set a timeout on a request. +func NewPutClustersParamsWithTimeout(timeout time.Duration) *PutClustersParams { + return &PutClustersParams{ + timeout: timeout, + } +} + +// NewPutClustersParamsWithContext creates a new PutClustersParams object +// with the ability to set a context for a request. +func NewPutClustersParamsWithContext(ctx context.Context) *PutClustersParams { + return &PutClustersParams{ + Context: ctx, + } +} + +// NewPutClustersParamsWithHTTPClient creates a new PutClustersParams object +// with the ability to set a custom HTTPClient for a request. +func NewPutClustersParamsWithHTTPClient(client *http.Client) *PutClustersParams { + return &PutClustersParams{ + HTTPClient: client, + } +} + +/* PutClustersParams contains all the parameters to send to the API endpoint + for the put clusters operation. + + Typically these are written to a http.Request. +*/ +type PutClustersParams struct { + + /* ClusterRequest. + + An array of Cluster records + */ + ClusterRequest *devops_models.ClusterRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put clusters params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutClustersParams) WithDefaults() *PutClustersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put clusters params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutClustersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the put clusters params +func (o *PutClustersParams) WithTimeout(timeout time.Duration) *PutClustersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put clusters params +func (o *PutClustersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put clusters params +func (o *PutClustersParams) WithContext(ctx context.Context) *PutClustersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put clusters params +func (o *PutClustersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put clusters params +func (o *PutClustersParams) WithHTTPClient(client *http.Client) *PutClustersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put clusters params +func (o *PutClustersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterRequest adds the clusterRequest to the put clusters params +func (o *PutClustersParams) WithClusterRequest(clusterRequest *devops_models.ClusterRequest) *PutClustersParams { + o.SetClusterRequest(clusterRequest) + return o +} + +// SetClusterRequest adds the clusterRequest to the put clusters params +func (o *PutClustersParams) SetClusterRequest(clusterRequest *devops_models.ClusterRequest) { + o.ClusterRequest = clusterRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutClustersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.ClusterRequest != nil { + if err := r.SetBodyParam(o.ClusterRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/cluster/put_clusters_responses.go b/api/devops/devops_client/cluster/put_clusters_responses.go new file mode 100644 index 0000000..3742fdf --- /dev/null +++ b/api/devops/devops_client/cluster/put_clusters_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cluster + +// 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/telnexus/lib/api/devops/devops_models" +) + +// PutClustersReader is a Reader for the PutClusters structure. +type PutClustersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutClustersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutClustersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutClustersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutClustersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutClustersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutClustersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutClustersInternalServerError() + 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()) + } +} + +// NewPutClustersOK creates a PutClustersOK with default headers values +func NewPutClustersOK() *PutClustersOK { + return &PutClustersOK{} +} + +/* PutClustersOK describes a response with status code 200, with default header values. + +Telnexus Response with Cluster objects +*/ +type PutClustersOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.ClusterResponse +} + +func (o *PutClustersOK) Error() string { + return fmt.Sprintf("[PUT /clusters][%d] putClustersOK %+v", 200, o.Payload) +} +func (o *PutClustersOK) GetPayload() *devops_models.ClusterResponse { + return o.Payload +} + +func (o *PutClustersOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.ClusterResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutClustersUnauthorized creates a PutClustersUnauthorized with default headers values +func NewPutClustersUnauthorized() *PutClustersUnauthorized { + return &PutClustersUnauthorized{} +} + +/* PutClustersUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutClustersUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PutClustersUnauthorized) Error() string { + return fmt.Sprintf("[PUT /clusters][%d] putClustersUnauthorized %+v", 401, o.Payload) +} +func (o *PutClustersUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutClustersUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutClustersForbidden creates a PutClustersForbidden with default headers values +func NewPutClustersForbidden() *PutClustersForbidden { + return &PutClustersForbidden{} +} + +/* PutClustersForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PutClustersForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PutClustersForbidden) Error() string { + return fmt.Sprintf("[PUT /clusters][%d] putClustersForbidden %+v", 403, o.Payload) +} +func (o *PutClustersForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutClustersForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutClustersNotFound creates a PutClustersNotFound with default headers values +func NewPutClustersNotFound() *PutClustersNotFound { + return &PutClustersNotFound{} +} + +/* PutClustersNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PutClustersNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PutClustersNotFound) Error() string { + return fmt.Sprintf("[PUT /clusters][%d] putClustersNotFound %+v", 404, o.Payload) +} +func (o *PutClustersNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutClustersNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutClustersUnprocessableEntity creates a PutClustersUnprocessableEntity with default headers values +func NewPutClustersUnprocessableEntity() *PutClustersUnprocessableEntity { + return &PutClustersUnprocessableEntity{} +} + +/* PutClustersUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutClustersUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PutClustersUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /clusters][%d] putClustersUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PutClustersUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutClustersUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutClustersInternalServerError creates a PutClustersInternalServerError with default headers values +func NewPutClustersInternalServerError() *PutClustersInternalServerError { + return &PutClustersInternalServerError{} +} + +/* PutClustersInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PutClustersInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PutClustersInternalServerError) Error() string { + return fmt.Sprintf("[PUT /clusters][%d] putClustersInternalServerError %+v", 500, o.Payload) +} +func (o *PutClustersInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutClustersInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/cors/cluster_options_parameters.go b/api/devops/devops_client/cors/cluster_options_parameters.go new file mode 100644 index 0000000..50d99f3 --- /dev/null +++ b/api/devops/devops_client/cors/cluster_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewClusterOptionsParams creates a new ClusterOptionsParams 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 NewClusterOptionsParams() *ClusterOptionsParams { + return &ClusterOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewClusterOptionsParamsWithTimeout creates a new ClusterOptionsParams object +// with the ability to set a timeout on a request. +func NewClusterOptionsParamsWithTimeout(timeout time.Duration) *ClusterOptionsParams { + return &ClusterOptionsParams{ + timeout: timeout, + } +} + +// NewClusterOptionsParamsWithContext creates a new ClusterOptionsParams object +// with the ability to set a context for a request. +func NewClusterOptionsParamsWithContext(ctx context.Context) *ClusterOptionsParams { + return &ClusterOptionsParams{ + Context: ctx, + } +} + +// NewClusterOptionsParamsWithHTTPClient creates a new ClusterOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewClusterOptionsParamsWithHTTPClient(client *http.Client) *ClusterOptionsParams { + return &ClusterOptionsParams{ + HTTPClient: client, + } +} + +/* ClusterOptionsParams contains all the parameters to send to the API endpoint + for the cluster options operation. + + Typically these are written to a http.Request. +*/ +type ClusterOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the cluster options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ClusterOptionsParams) WithDefaults() *ClusterOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the cluster options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ClusterOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the cluster options params +func (o *ClusterOptionsParams) WithTimeout(timeout time.Duration) *ClusterOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cluster options params +func (o *ClusterOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cluster options params +func (o *ClusterOptionsParams) WithContext(ctx context.Context) *ClusterOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cluster options params +func (o *ClusterOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cluster options params +func (o *ClusterOptionsParams) WithHTTPClient(client *http.Client) *ClusterOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cluster options params +func (o *ClusterOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ClusterOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/cors/cluster_options_responses.go b/api/devops/devops_client/cors/cluster_options_responses.go new file mode 100644 index 0000000..3adafee --- /dev/null +++ b/api/devops/devops_client/cors/cluster_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// ClusterOptionsReader is a Reader for the ClusterOptions structure. +type ClusterOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ClusterOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewClusterOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewClusterOptionsOK creates a ClusterOptionsOK with default headers values +func NewClusterOptionsOK() *ClusterOptionsOK { + return &ClusterOptionsOK{} +} + +/* ClusterOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type ClusterOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *ClusterOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /clusters/observable][%d] clusterOptionsOK ", 200) +} + +func (o *ClusterOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/devops/devops_client/cors/clusters_options_parameters.go b/api/devops/devops_client/cors/clusters_options_parameters.go new file mode 100644 index 0000000..ab8227e --- /dev/null +++ b/api/devops/devops_client/cors/clusters_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewClustersOptionsParams creates a new ClustersOptionsParams 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 NewClustersOptionsParams() *ClustersOptionsParams { + return &ClustersOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewClustersOptionsParamsWithTimeout creates a new ClustersOptionsParams object +// with the ability to set a timeout on a request. +func NewClustersOptionsParamsWithTimeout(timeout time.Duration) *ClustersOptionsParams { + return &ClustersOptionsParams{ + timeout: timeout, + } +} + +// NewClustersOptionsParamsWithContext creates a new ClustersOptionsParams object +// with the ability to set a context for a request. +func NewClustersOptionsParamsWithContext(ctx context.Context) *ClustersOptionsParams { + return &ClustersOptionsParams{ + Context: ctx, + } +} + +// NewClustersOptionsParamsWithHTTPClient creates a new ClustersOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewClustersOptionsParamsWithHTTPClient(client *http.Client) *ClustersOptionsParams { + return &ClustersOptionsParams{ + HTTPClient: client, + } +} + +/* ClustersOptionsParams contains all the parameters to send to the API endpoint + for the clusters options operation. + + Typically these are written to a http.Request. +*/ +type ClustersOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the clusters options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ClustersOptionsParams) WithDefaults() *ClustersOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the clusters options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ClustersOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the clusters options params +func (o *ClustersOptionsParams) WithTimeout(timeout time.Duration) *ClustersOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the clusters options params +func (o *ClustersOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the clusters options params +func (o *ClustersOptionsParams) WithContext(ctx context.Context) *ClustersOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the clusters options params +func (o *ClustersOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the clusters options params +func (o *ClustersOptionsParams) WithHTTPClient(client *http.Client) *ClustersOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the clusters options params +func (o *ClustersOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ClustersOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/cors/clusters_options_responses.go b/api/devops/devops_client/cors/clusters_options_responses.go new file mode 100644 index 0000000..6a2bac9 --- /dev/null +++ b/api/devops/devops_client/cors/clusters_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// ClustersOptionsReader is a Reader for the ClustersOptions structure. +type ClustersOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ClustersOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewClustersOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewClustersOptionsOK creates a ClustersOptionsOK with default headers values +func NewClustersOptionsOK() *ClustersOptionsOK { + return &ClustersOptionsOK{} +} + +/* ClustersOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type ClustersOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *ClustersOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /clusters][%d] clustersOptionsOK ", 200) +} + +func (o *ClustersOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/devops/devops_client/cors/cors_client.go b/api/devops/devops_client/cors/cors_client.go new file mode 100644 index 0000000..72fa82a --- /dev/null +++ b/api/devops/devops_client/cors/cors_client.go @@ -0,0 +1,683 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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 cors API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for cors 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 { + ClusterOptions(params *ClusterOptionsParams, opts ...ClientOption) (*ClusterOptionsOK, error) + + ClustersOptions(params *ClustersOptionsParams, opts ...ClientOption) (*ClustersOptionsOK, error) + + DatabaseOptions(params *DatabaseOptionsParams, opts ...ClientOption) (*DatabaseOptionsOK, error) + + DatabasesOptions(params *DatabasesOptionsParams, opts ...ClientOption) (*DatabasesOptionsOK, error) + + IngestOptions(params *IngestOptionsParams, opts ...ClientOption) (*IngestOptionsOK, error) + + IngestsOptions(params *IngestsOptionsParams, opts ...ClientOption) (*IngestsOptionsOK, error) + + JobOptions(params *JobOptionsParams, opts ...ClientOption) (*JobOptionsOK, error) + + JobsOptions(params *JobsOptionsParams, opts ...ClientOption) (*JobsOptionsOK, error) + + ServiceOptions(params *ServiceOptionsParams, opts ...ClientOption) (*ServiceOptionsOK, error) + + ServicesOptions(params *ServicesOptionsParams, opts ...ClientOption) (*ServicesOptionsOK, error) + + TemplateOptions(params *TemplateOptionsParams, opts ...ClientOption) (*TemplateOptionsOK, error) + + TemplatesOptions(params *TemplatesOptionsParams, opts ...ClientOption) (*TemplatesOptionsOK, error) + + TenantOptions(params *TenantOptionsParams, opts ...ClientOption) (*TenantOptionsOK, error) + + TenantsOptions(params *TenantsOptionsParams, opts ...ClientOption) (*TenantsOptionsOK, error) + + UserOptions(params *UserOptionsParams, opts ...ClientOption) (*UserOptionsOK, error) + + UsersOptions(params *UsersOptionsParams, opts ...ClientOption) (*UsersOptionsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + ClusterOptions CORS support +*/ +func (a *Client) ClusterOptions(params *ClusterOptionsParams, opts ...ClientOption) (*ClusterOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewClusterOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "clusterOptions", + Method: "OPTIONS", + PathPattern: "/clusters/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ClusterOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ClusterOptionsOK) + 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 clusterOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ClustersOptions CORS support +*/ +func (a *Client) ClustersOptions(params *ClustersOptionsParams, opts ...ClientOption) (*ClustersOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewClustersOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "clustersOptions", + Method: "OPTIONS", + PathPattern: "/clusters", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ClustersOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ClustersOptionsOK) + 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 clustersOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + DatabaseOptions CORS support +*/ +func (a *Client) DatabaseOptions(params *DatabaseOptionsParams, opts ...ClientOption) (*DatabaseOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDatabaseOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "databaseOptions", + Method: "OPTIONS", + PathPattern: "/databases/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DatabaseOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DatabaseOptionsOK) + 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 databaseOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + DatabasesOptions CORS support +*/ +func (a *Client) DatabasesOptions(params *DatabasesOptionsParams, opts ...ClientOption) (*DatabasesOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDatabasesOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "databasesOptions", + Method: "OPTIONS", + PathPattern: "/databases", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DatabasesOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DatabasesOptionsOK) + 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 databasesOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IngestOptions CORS support +*/ +func (a *Client) IngestOptions(params *IngestOptionsParams, opts ...ClientOption) (*IngestOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIngestOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "ingestOptions", + Method: "OPTIONS", + PathPattern: "/ingests/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IngestOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IngestOptionsOK) + 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 ingestOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IngestsOptions CORS support +*/ +func (a *Client) IngestsOptions(params *IngestsOptionsParams, opts ...ClientOption) (*IngestsOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIngestsOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "ingestsOptions", + Method: "OPTIONS", + PathPattern: "/ingests", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IngestsOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IngestsOptionsOK) + 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 ingestsOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + JobOptions CORS support +*/ +func (a *Client) JobOptions(params *JobOptionsParams, opts ...ClientOption) (*JobOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewJobOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "jobOptions", + Method: "OPTIONS", + PathPattern: "/jobs/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &JobOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*JobOptionsOK) + 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 jobOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + JobsOptions CORS support +*/ +func (a *Client) JobsOptions(params *JobsOptionsParams, opts ...ClientOption) (*JobsOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewJobsOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "jobsOptions", + Method: "OPTIONS", + PathPattern: "/jobs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &JobsOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*JobsOptionsOK) + 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 jobsOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ServiceOptions CORS support +*/ +func (a *Client) ServiceOptions(params *ServiceOptionsParams, opts ...ClientOption) (*ServiceOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewServiceOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "serviceOptions", + Method: "OPTIONS", + PathPattern: "/services/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ServiceOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ServiceOptionsOK) + 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 serviceOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ServicesOptions CORS support +*/ +func (a *Client) ServicesOptions(params *ServicesOptionsParams, opts ...ClientOption) (*ServicesOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewServicesOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "servicesOptions", + Method: "OPTIONS", + PathPattern: "/services", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ServicesOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ServicesOptionsOK) + 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 servicesOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TemplateOptions CORS support +*/ +func (a *Client) TemplateOptions(params *TemplateOptionsParams, opts ...ClientOption) (*TemplateOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTemplateOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "templateOptions", + Method: "OPTIONS", + PathPattern: "/templates/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TemplateOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TemplateOptionsOK) + 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 templateOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TemplatesOptions CORS support +*/ +func (a *Client) TemplatesOptions(params *TemplatesOptionsParams, opts ...ClientOption) (*TemplatesOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTemplatesOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "templatesOptions", + Method: "OPTIONS", + PathPattern: "/templates", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TemplatesOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TemplatesOptionsOK) + 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 templatesOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenantOptions CORS support +*/ +func (a *Client) TenantOptions(params *TenantOptionsParams, opts ...ClientOption) (*TenantOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenantOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "tenantOptions", + Method: "OPTIONS", + PathPattern: "/tenants/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenantOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenantOptionsOK) + 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 tenantOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenantsOptions CORS support +*/ +func (a *Client) TenantsOptions(params *TenantsOptionsParams, opts ...ClientOption) (*TenantsOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenantsOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "tenantsOptions", + Method: "OPTIONS", + PathPattern: "/tenants", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenantsOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenantsOptionsOK) + 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 tenantsOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + UserOptions CORS support +*/ +func (a *Client) UserOptions(params *UserOptionsParams, opts ...ClientOption) (*UserOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUserOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "userOptions", + Method: "OPTIONS", + PathPattern: "/users/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UserOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UserOptionsOK) + 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 userOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + UsersOptions CORS support +*/ +func (a *Client) UsersOptions(params *UsersOptionsParams, opts ...ClientOption) (*UsersOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUsersOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "usersOptions", + Method: "OPTIONS", + PathPattern: "/users", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UsersOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UsersOptionsOK) + 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 usersOptions: 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 +} diff --git a/api/devops/devops_client/cors/database_options_parameters.go b/api/devops/devops_client/cors/database_options_parameters.go new file mode 100644 index 0000000..9b6c45d --- /dev/null +++ b/api/devops/devops_client/cors/database_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewDatabaseOptionsParams creates a new DatabaseOptionsParams 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 NewDatabaseOptionsParams() *DatabaseOptionsParams { + return &DatabaseOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDatabaseOptionsParamsWithTimeout creates a new DatabaseOptionsParams object +// with the ability to set a timeout on a request. +func NewDatabaseOptionsParamsWithTimeout(timeout time.Duration) *DatabaseOptionsParams { + return &DatabaseOptionsParams{ + timeout: timeout, + } +} + +// NewDatabaseOptionsParamsWithContext creates a new DatabaseOptionsParams object +// with the ability to set a context for a request. +func NewDatabaseOptionsParamsWithContext(ctx context.Context) *DatabaseOptionsParams { + return &DatabaseOptionsParams{ + Context: ctx, + } +} + +// NewDatabaseOptionsParamsWithHTTPClient creates a new DatabaseOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewDatabaseOptionsParamsWithHTTPClient(client *http.Client) *DatabaseOptionsParams { + return &DatabaseOptionsParams{ + HTTPClient: client, + } +} + +/* DatabaseOptionsParams contains all the parameters to send to the API endpoint + for the database options operation. + + Typically these are written to a http.Request. +*/ +type DatabaseOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the database options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DatabaseOptionsParams) WithDefaults() *DatabaseOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the database options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DatabaseOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the database options params +func (o *DatabaseOptionsParams) WithTimeout(timeout time.Duration) *DatabaseOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the database options params +func (o *DatabaseOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the database options params +func (o *DatabaseOptionsParams) WithContext(ctx context.Context) *DatabaseOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the database options params +func (o *DatabaseOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the database options params +func (o *DatabaseOptionsParams) WithHTTPClient(client *http.Client) *DatabaseOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the database options params +func (o *DatabaseOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *DatabaseOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/cors/database_options_responses.go b/api/devops/devops_client/cors/database_options_responses.go new file mode 100644 index 0000000..a76ee10 --- /dev/null +++ b/api/devops/devops_client/cors/database_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// DatabaseOptionsReader is a Reader for the DatabaseOptions structure. +type DatabaseOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DatabaseOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDatabaseOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewDatabaseOptionsOK creates a DatabaseOptionsOK with default headers values +func NewDatabaseOptionsOK() *DatabaseOptionsOK { + return &DatabaseOptionsOK{} +} + +/* DatabaseOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type DatabaseOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *DatabaseOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /databases/observable][%d] databaseOptionsOK ", 200) +} + +func (o *DatabaseOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/devops/devops_client/cors/databases_options_parameters.go b/api/devops/devops_client/cors/databases_options_parameters.go new file mode 100644 index 0000000..aa0f171 --- /dev/null +++ b/api/devops/devops_client/cors/databases_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewDatabasesOptionsParams creates a new DatabasesOptionsParams 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 NewDatabasesOptionsParams() *DatabasesOptionsParams { + return &DatabasesOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDatabasesOptionsParamsWithTimeout creates a new DatabasesOptionsParams object +// with the ability to set a timeout on a request. +func NewDatabasesOptionsParamsWithTimeout(timeout time.Duration) *DatabasesOptionsParams { + return &DatabasesOptionsParams{ + timeout: timeout, + } +} + +// NewDatabasesOptionsParamsWithContext creates a new DatabasesOptionsParams object +// with the ability to set a context for a request. +func NewDatabasesOptionsParamsWithContext(ctx context.Context) *DatabasesOptionsParams { + return &DatabasesOptionsParams{ + Context: ctx, + } +} + +// NewDatabasesOptionsParamsWithHTTPClient creates a new DatabasesOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewDatabasesOptionsParamsWithHTTPClient(client *http.Client) *DatabasesOptionsParams { + return &DatabasesOptionsParams{ + HTTPClient: client, + } +} + +/* DatabasesOptionsParams contains all the parameters to send to the API endpoint + for the databases options operation. + + Typically these are written to a http.Request. +*/ +type DatabasesOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the databases options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DatabasesOptionsParams) WithDefaults() *DatabasesOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the databases options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DatabasesOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the databases options params +func (o *DatabasesOptionsParams) WithTimeout(timeout time.Duration) *DatabasesOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the databases options params +func (o *DatabasesOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the databases options params +func (o *DatabasesOptionsParams) WithContext(ctx context.Context) *DatabasesOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the databases options params +func (o *DatabasesOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the databases options params +func (o *DatabasesOptionsParams) WithHTTPClient(client *http.Client) *DatabasesOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the databases options params +func (o *DatabasesOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *DatabasesOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/cors/databases_options_responses.go b/api/devops/devops_client/cors/databases_options_responses.go new file mode 100644 index 0000000..a003d64 --- /dev/null +++ b/api/devops/devops_client/cors/databases_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// DatabasesOptionsReader is a Reader for the DatabasesOptions structure. +type DatabasesOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DatabasesOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDatabasesOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewDatabasesOptionsOK creates a DatabasesOptionsOK with default headers values +func NewDatabasesOptionsOK() *DatabasesOptionsOK { + return &DatabasesOptionsOK{} +} + +/* DatabasesOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type DatabasesOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *DatabasesOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /databases][%d] databasesOptionsOK ", 200) +} + +func (o *DatabasesOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/devops/devops_client/cors/ingest_options_parameters.go b/api/devops/devops_client/cors/ingest_options_parameters.go new file mode 100644 index 0000000..6ba9bef --- /dev/null +++ b/api/devops/devops_client/cors/ingest_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewIngestOptionsParams creates a new IngestOptionsParams 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 NewIngestOptionsParams() *IngestOptionsParams { + return &IngestOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIngestOptionsParamsWithTimeout creates a new IngestOptionsParams object +// with the ability to set a timeout on a request. +func NewIngestOptionsParamsWithTimeout(timeout time.Duration) *IngestOptionsParams { + return &IngestOptionsParams{ + timeout: timeout, + } +} + +// NewIngestOptionsParamsWithContext creates a new IngestOptionsParams object +// with the ability to set a context for a request. +func NewIngestOptionsParamsWithContext(ctx context.Context) *IngestOptionsParams { + return &IngestOptionsParams{ + Context: ctx, + } +} + +// NewIngestOptionsParamsWithHTTPClient creates a new IngestOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewIngestOptionsParamsWithHTTPClient(client *http.Client) *IngestOptionsParams { + return &IngestOptionsParams{ + HTTPClient: client, + } +} + +/* IngestOptionsParams contains all the parameters to send to the API endpoint + for the ingest options operation. + + Typically these are written to a http.Request. +*/ +type IngestOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ingest options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IngestOptionsParams) WithDefaults() *IngestOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ingest options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IngestOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ingest options params +func (o *IngestOptionsParams) WithTimeout(timeout time.Duration) *IngestOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ingest options params +func (o *IngestOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ingest options params +func (o *IngestOptionsParams) WithContext(ctx context.Context) *IngestOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ingest options params +func (o *IngestOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ingest options params +func (o *IngestOptionsParams) WithHTTPClient(client *http.Client) *IngestOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ingest options params +func (o *IngestOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *IngestOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/cors/ingest_options_responses.go b/api/devops/devops_client/cors/ingest_options_responses.go new file mode 100644 index 0000000..1854701 --- /dev/null +++ b/api/devops/devops_client/cors/ingest_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// IngestOptionsReader is a Reader for the IngestOptions structure. +type IngestOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IngestOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewIngestOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewIngestOptionsOK creates a IngestOptionsOK with default headers values +func NewIngestOptionsOK() *IngestOptionsOK { + return &IngestOptionsOK{} +} + +/* IngestOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type IngestOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *IngestOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /ingests/observable][%d] ingestOptionsOK ", 200) +} + +func (o *IngestOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/devops/devops_client/cors/ingests_options_parameters.go b/api/devops/devops_client/cors/ingests_options_parameters.go new file mode 100644 index 0000000..a4a19e9 --- /dev/null +++ b/api/devops/devops_client/cors/ingests_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewIngestsOptionsParams creates a new IngestsOptionsParams 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 NewIngestsOptionsParams() *IngestsOptionsParams { + return &IngestsOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIngestsOptionsParamsWithTimeout creates a new IngestsOptionsParams object +// with the ability to set a timeout on a request. +func NewIngestsOptionsParamsWithTimeout(timeout time.Duration) *IngestsOptionsParams { + return &IngestsOptionsParams{ + timeout: timeout, + } +} + +// NewIngestsOptionsParamsWithContext creates a new IngestsOptionsParams object +// with the ability to set a context for a request. +func NewIngestsOptionsParamsWithContext(ctx context.Context) *IngestsOptionsParams { + return &IngestsOptionsParams{ + Context: ctx, + } +} + +// NewIngestsOptionsParamsWithHTTPClient creates a new IngestsOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewIngestsOptionsParamsWithHTTPClient(client *http.Client) *IngestsOptionsParams { + return &IngestsOptionsParams{ + HTTPClient: client, + } +} + +/* IngestsOptionsParams contains all the parameters to send to the API endpoint + for the ingests options operation. + + Typically these are written to a http.Request. +*/ +type IngestsOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ingests options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IngestsOptionsParams) WithDefaults() *IngestsOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ingests options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IngestsOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ingests options params +func (o *IngestsOptionsParams) WithTimeout(timeout time.Duration) *IngestsOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ingests options params +func (o *IngestsOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ingests options params +func (o *IngestsOptionsParams) WithContext(ctx context.Context) *IngestsOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ingests options params +func (o *IngestsOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ingests options params +func (o *IngestsOptionsParams) WithHTTPClient(client *http.Client) *IngestsOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ingests options params +func (o *IngestsOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *IngestsOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/cors/ingests_options_responses.go b/api/devops/devops_client/cors/ingests_options_responses.go new file mode 100644 index 0000000..d9f807c --- /dev/null +++ b/api/devops/devops_client/cors/ingests_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// IngestsOptionsReader is a Reader for the IngestsOptions structure. +type IngestsOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IngestsOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewIngestsOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewIngestsOptionsOK creates a IngestsOptionsOK with default headers values +func NewIngestsOptionsOK() *IngestsOptionsOK { + return &IngestsOptionsOK{} +} + +/* IngestsOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type IngestsOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *IngestsOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /ingests][%d] ingestsOptionsOK ", 200) +} + +func (o *IngestsOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/devops/devops_client/cors/job_options_parameters.go b/api/devops/devops_client/cors/job_options_parameters.go new file mode 100644 index 0000000..fca0424 --- /dev/null +++ b/api/devops/devops_client/cors/job_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewJobOptionsParams creates a new JobOptionsParams 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 NewJobOptionsParams() *JobOptionsParams { + return &JobOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewJobOptionsParamsWithTimeout creates a new JobOptionsParams object +// with the ability to set a timeout on a request. +func NewJobOptionsParamsWithTimeout(timeout time.Duration) *JobOptionsParams { + return &JobOptionsParams{ + timeout: timeout, + } +} + +// NewJobOptionsParamsWithContext creates a new JobOptionsParams object +// with the ability to set a context for a request. +func NewJobOptionsParamsWithContext(ctx context.Context) *JobOptionsParams { + return &JobOptionsParams{ + Context: ctx, + } +} + +// NewJobOptionsParamsWithHTTPClient creates a new JobOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewJobOptionsParamsWithHTTPClient(client *http.Client) *JobOptionsParams { + return &JobOptionsParams{ + HTTPClient: client, + } +} + +/* JobOptionsParams contains all the parameters to send to the API endpoint + for the job options operation. + + Typically these are written to a http.Request. +*/ +type JobOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the job options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *JobOptionsParams) WithDefaults() *JobOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the job options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *JobOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the job options params +func (o *JobOptionsParams) WithTimeout(timeout time.Duration) *JobOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the job options params +func (o *JobOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the job options params +func (o *JobOptionsParams) WithContext(ctx context.Context) *JobOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the job options params +func (o *JobOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the job options params +func (o *JobOptionsParams) WithHTTPClient(client *http.Client) *JobOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the job options params +func (o *JobOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *JobOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/cors/job_options_responses.go b/api/devops/devops_client/cors/job_options_responses.go new file mode 100644 index 0000000..87e6391 --- /dev/null +++ b/api/devops/devops_client/cors/job_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// JobOptionsReader is a Reader for the JobOptions structure. +type JobOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *JobOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewJobOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewJobOptionsOK creates a JobOptionsOK with default headers values +func NewJobOptionsOK() *JobOptionsOK { + return &JobOptionsOK{} +} + +/* JobOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type JobOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *JobOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /jobs/observable][%d] jobOptionsOK ", 200) +} + +func (o *JobOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/devops/devops_client/cors/jobs_options_parameters.go b/api/devops/devops_client/cors/jobs_options_parameters.go new file mode 100644 index 0000000..f0b4b1b --- /dev/null +++ b/api/devops/devops_client/cors/jobs_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewJobsOptionsParams creates a new JobsOptionsParams 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 NewJobsOptionsParams() *JobsOptionsParams { + return &JobsOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewJobsOptionsParamsWithTimeout creates a new JobsOptionsParams object +// with the ability to set a timeout on a request. +func NewJobsOptionsParamsWithTimeout(timeout time.Duration) *JobsOptionsParams { + return &JobsOptionsParams{ + timeout: timeout, + } +} + +// NewJobsOptionsParamsWithContext creates a new JobsOptionsParams object +// with the ability to set a context for a request. +func NewJobsOptionsParamsWithContext(ctx context.Context) *JobsOptionsParams { + return &JobsOptionsParams{ + Context: ctx, + } +} + +// NewJobsOptionsParamsWithHTTPClient creates a new JobsOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewJobsOptionsParamsWithHTTPClient(client *http.Client) *JobsOptionsParams { + return &JobsOptionsParams{ + HTTPClient: client, + } +} + +/* JobsOptionsParams contains all the parameters to send to the API endpoint + for the jobs options operation. + + Typically these are written to a http.Request. +*/ +type JobsOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the jobs options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *JobsOptionsParams) WithDefaults() *JobsOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the jobs options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *JobsOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the jobs options params +func (o *JobsOptionsParams) WithTimeout(timeout time.Duration) *JobsOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the jobs options params +func (o *JobsOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the jobs options params +func (o *JobsOptionsParams) WithContext(ctx context.Context) *JobsOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the jobs options params +func (o *JobsOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the jobs options params +func (o *JobsOptionsParams) WithHTTPClient(client *http.Client) *JobsOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the jobs options params +func (o *JobsOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *JobsOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/cors/jobs_options_responses.go b/api/devops/devops_client/cors/jobs_options_responses.go new file mode 100644 index 0000000..40c6a02 --- /dev/null +++ b/api/devops/devops_client/cors/jobs_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// JobsOptionsReader is a Reader for the JobsOptions structure. +type JobsOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *JobsOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewJobsOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewJobsOptionsOK creates a JobsOptionsOK with default headers values +func NewJobsOptionsOK() *JobsOptionsOK { + return &JobsOptionsOK{} +} + +/* JobsOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type JobsOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *JobsOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /jobs][%d] jobsOptionsOK ", 200) +} + +func (o *JobsOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/devops/devops_client/cors/service_options_parameters.go b/api/devops/devops_client/cors/service_options_parameters.go new file mode 100644 index 0000000..d36479b --- /dev/null +++ b/api/devops/devops_client/cors/service_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewServiceOptionsParams creates a new ServiceOptionsParams 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 NewServiceOptionsParams() *ServiceOptionsParams { + return &ServiceOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewServiceOptionsParamsWithTimeout creates a new ServiceOptionsParams object +// with the ability to set a timeout on a request. +func NewServiceOptionsParamsWithTimeout(timeout time.Duration) *ServiceOptionsParams { + return &ServiceOptionsParams{ + timeout: timeout, + } +} + +// NewServiceOptionsParamsWithContext creates a new ServiceOptionsParams object +// with the ability to set a context for a request. +func NewServiceOptionsParamsWithContext(ctx context.Context) *ServiceOptionsParams { + return &ServiceOptionsParams{ + Context: ctx, + } +} + +// NewServiceOptionsParamsWithHTTPClient creates a new ServiceOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewServiceOptionsParamsWithHTTPClient(client *http.Client) *ServiceOptionsParams { + return &ServiceOptionsParams{ + HTTPClient: client, + } +} + +/* ServiceOptionsParams contains all the parameters to send to the API endpoint + for the service options operation. + + Typically these are written to a http.Request. +*/ +type ServiceOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the service options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceOptionsParams) WithDefaults() *ServiceOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the service options params +func (o *ServiceOptionsParams) WithTimeout(timeout time.Duration) *ServiceOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the service options params +func (o *ServiceOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the service options params +func (o *ServiceOptionsParams) WithContext(ctx context.Context) *ServiceOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the service options params +func (o *ServiceOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the service options params +func (o *ServiceOptionsParams) WithHTTPClient(client *http.Client) *ServiceOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the service options params +func (o *ServiceOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ServiceOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/cors/service_options_responses.go b/api/devops/devops_client/cors/service_options_responses.go new file mode 100644 index 0000000..4656ca4 --- /dev/null +++ b/api/devops/devops_client/cors/service_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// ServiceOptionsReader is a Reader for the ServiceOptions structure. +type ServiceOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ServiceOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewServiceOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewServiceOptionsOK creates a ServiceOptionsOK with default headers values +func NewServiceOptionsOK() *ServiceOptionsOK { + return &ServiceOptionsOK{} +} + +/* ServiceOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type ServiceOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *ServiceOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /services/observable][%d] serviceOptionsOK ", 200) +} + +func (o *ServiceOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/devops/devops_client/cors/services_options_parameters.go b/api/devops/devops_client/cors/services_options_parameters.go new file mode 100644 index 0000000..caf8cbe --- /dev/null +++ b/api/devops/devops_client/cors/services_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewServicesOptionsParams creates a new ServicesOptionsParams 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 NewServicesOptionsParams() *ServicesOptionsParams { + return &ServicesOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewServicesOptionsParamsWithTimeout creates a new ServicesOptionsParams object +// with the ability to set a timeout on a request. +func NewServicesOptionsParamsWithTimeout(timeout time.Duration) *ServicesOptionsParams { + return &ServicesOptionsParams{ + timeout: timeout, + } +} + +// NewServicesOptionsParamsWithContext creates a new ServicesOptionsParams object +// with the ability to set a context for a request. +func NewServicesOptionsParamsWithContext(ctx context.Context) *ServicesOptionsParams { + return &ServicesOptionsParams{ + Context: ctx, + } +} + +// NewServicesOptionsParamsWithHTTPClient creates a new ServicesOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewServicesOptionsParamsWithHTTPClient(client *http.Client) *ServicesOptionsParams { + return &ServicesOptionsParams{ + HTTPClient: client, + } +} + +/* ServicesOptionsParams contains all the parameters to send to the API endpoint + for the services options operation. + + Typically these are written to a http.Request. +*/ +type ServicesOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the services options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServicesOptionsParams) WithDefaults() *ServicesOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the services options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServicesOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the services options params +func (o *ServicesOptionsParams) WithTimeout(timeout time.Duration) *ServicesOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the services options params +func (o *ServicesOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the services options params +func (o *ServicesOptionsParams) WithContext(ctx context.Context) *ServicesOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the services options params +func (o *ServicesOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the services options params +func (o *ServicesOptionsParams) WithHTTPClient(client *http.Client) *ServicesOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the services options params +func (o *ServicesOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ServicesOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/cors/services_options_responses.go b/api/devops/devops_client/cors/services_options_responses.go new file mode 100644 index 0000000..f4138ea --- /dev/null +++ b/api/devops/devops_client/cors/services_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// ServicesOptionsReader is a Reader for the ServicesOptions structure. +type ServicesOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ServicesOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewServicesOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewServicesOptionsOK creates a ServicesOptionsOK with default headers values +func NewServicesOptionsOK() *ServicesOptionsOK { + return &ServicesOptionsOK{} +} + +/* ServicesOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type ServicesOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *ServicesOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /services][%d] servicesOptionsOK ", 200) +} + +func (o *ServicesOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/devops/devops_client/cors/template_options_parameters.go b/api/devops/devops_client/cors/template_options_parameters.go new file mode 100644 index 0000000..9bbbe81 --- /dev/null +++ b/api/devops/devops_client/cors/template_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewTemplateOptionsParams creates a new TemplateOptionsParams 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 NewTemplateOptionsParams() *TemplateOptionsParams { + return &TemplateOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTemplateOptionsParamsWithTimeout creates a new TemplateOptionsParams object +// with the ability to set a timeout on a request. +func NewTemplateOptionsParamsWithTimeout(timeout time.Duration) *TemplateOptionsParams { + return &TemplateOptionsParams{ + timeout: timeout, + } +} + +// NewTemplateOptionsParamsWithContext creates a new TemplateOptionsParams object +// with the ability to set a context for a request. +func NewTemplateOptionsParamsWithContext(ctx context.Context) *TemplateOptionsParams { + return &TemplateOptionsParams{ + Context: ctx, + } +} + +// NewTemplateOptionsParamsWithHTTPClient creates a new TemplateOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewTemplateOptionsParamsWithHTTPClient(client *http.Client) *TemplateOptionsParams { + return &TemplateOptionsParams{ + HTTPClient: client, + } +} + +/* TemplateOptionsParams contains all the parameters to send to the API endpoint + for the template options operation. + + Typically these are written to a http.Request. +*/ +type TemplateOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the template options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TemplateOptionsParams) WithDefaults() *TemplateOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the template options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TemplateOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the template options params +func (o *TemplateOptionsParams) WithTimeout(timeout time.Duration) *TemplateOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the template options params +func (o *TemplateOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the template options params +func (o *TemplateOptionsParams) WithContext(ctx context.Context) *TemplateOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the template options params +func (o *TemplateOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the template options params +func (o *TemplateOptionsParams) WithHTTPClient(client *http.Client) *TemplateOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the template options params +func (o *TemplateOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *TemplateOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/cors/template_options_responses.go b/api/devops/devops_client/cors/template_options_responses.go new file mode 100644 index 0000000..9f79089 --- /dev/null +++ b/api/devops/devops_client/cors/template_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// TemplateOptionsReader is a Reader for the TemplateOptions structure. +type TemplateOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TemplateOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTemplateOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewTemplateOptionsOK creates a TemplateOptionsOK with default headers values +func NewTemplateOptionsOK() *TemplateOptionsOK { + return &TemplateOptionsOK{} +} + +/* TemplateOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type TemplateOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *TemplateOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /templates/observable][%d] templateOptionsOK ", 200) +} + +func (o *TemplateOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/devops/devops_client/cors/templates_options_parameters.go b/api/devops/devops_client/cors/templates_options_parameters.go new file mode 100644 index 0000000..03b0412 --- /dev/null +++ b/api/devops/devops_client/cors/templates_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewTemplatesOptionsParams creates a new TemplatesOptionsParams 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 NewTemplatesOptionsParams() *TemplatesOptionsParams { + return &TemplatesOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTemplatesOptionsParamsWithTimeout creates a new TemplatesOptionsParams object +// with the ability to set a timeout on a request. +func NewTemplatesOptionsParamsWithTimeout(timeout time.Duration) *TemplatesOptionsParams { + return &TemplatesOptionsParams{ + timeout: timeout, + } +} + +// NewTemplatesOptionsParamsWithContext creates a new TemplatesOptionsParams object +// with the ability to set a context for a request. +func NewTemplatesOptionsParamsWithContext(ctx context.Context) *TemplatesOptionsParams { + return &TemplatesOptionsParams{ + Context: ctx, + } +} + +// NewTemplatesOptionsParamsWithHTTPClient creates a new TemplatesOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewTemplatesOptionsParamsWithHTTPClient(client *http.Client) *TemplatesOptionsParams { + return &TemplatesOptionsParams{ + HTTPClient: client, + } +} + +/* TemplatesOptionsParams contains all the parameters to send to the API endpoint + for the templates options operation. + + Typically these are written to a http.Request. +*/ +type TemplatesOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the templates options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TemplatesOptionsParams) WithDefaults() *TemplatesOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the templates options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TemplatesOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the templates options params +func (o *TemplatesOptionsParams) WithTimeout(timeout time.Duration) *TemplatesOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the templates options params +func (o *TemplatesOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the templates options params +func (o *TemplatesOptionsParams) WithContext(ctx context.Context) *TemplatesOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the templates options params +func (o *TemplatesOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the templates options params +func (o *TemplatesOptionsParams) WithHTTPClient(client *http.Client) *TemplatesOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the templates options params +func (o *TemplatesOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *TemplatesOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/cors/templates_options_responses.go b/api/devops/devops_client/cors/templates_options_responses.go new file mode 100644 index 0000000..6719161 --- /dev/null +++ b/api/devops/devops_client/cors/templates_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// TemplatesOptionsReader is a Reader for the TemplatesOptions structure. +type TemplatesOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TemplatesOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTemplatesOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewTemplatesOptionsOK creates a TemplatesOptionsOK with default headers values +func NewTemplatesOptionsOK() *TemplatesOptionsOK { + return &TemplatesOptionsOK{} +} + +/* TemplatesOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type TemplatesOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *TemplatesOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /templates][%d] templatesOptionsOK ", 200) +} + +func (o *TemplatesOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/devops/devops_client/cors/tenant_options_parameters.go b/api/devops/devops_client/cors/tenant_options_parameters.go new file mode 100644 index 0000000..3379962 --- /dev/null +++ b/api/devops/devops_client/cors/tenant_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewTenantOptionsParams creates a new TenantOptionsParams 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 NewTenantOptionsParams() *TenantOptionsParams { + return &TenantOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenantOptionsParamsWithTimeout creates a new TenantOptionsParams object +// with the ability to set a timeout on a request. +func NewTenantOptionsParamsWithTimeout(timeout time.Duration) *TenantOptionsParams { + return &TenantOptionsParams{ + timeout: timeout, + } +} + +// NewTenantOptionsParamsWithContext creates a new TenantOptionsParams object +// with the ability to set a context for a request. +func NewTenantOptionsParamsWithContext(ctx context.Context) *TenantOptionsParams { + return &TenantOptionsParams{ + Context: ctx, + } +} + +// NewTenantOptionsParamsWithHTTPClient creates a new TenantOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenantOptionsParamsWithHTTPClient(client *http.Client) *TenantOptionsParams { + return &TenantOptionsParams{ + HTTPClient: client, + } +} + +/* TenantOptionsParams contains all the parameters to send to the API endpoint + for the tenant options operation. + + Typically these are written to a http.Request. +*/ +type TenantOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenant options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenantOptionsParams) WithDefaults() *TenantOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenant options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenantOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenant options params +func (o *TenantOptionsParams) WithTimeout(timeout time.Duration) *TenantOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenant options params +func (o *TenantOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenant options params +func (o *TenantOptionsParams) WithContext(ctx context.Context) *TenantOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenant options params +func (o *TenantOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenant options params +func (o *TenantOptionsParams) WithHTTPClient(client *http.Client) *TenantOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenant options params +func (o *TenantOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *TenantOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/cors/tenant_options_responses.go b/api/devops/devops_client/cors/tenant_options_responses.go new file mode 100644 index 0000000..7e89f92 --- /dev/null +++ b/api/devops/devops_client/cors/tenant_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// TenantOptionsReader is a Reader for the TenantOptions structure. +type TenantOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenantOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenantOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewTenantOptionsOK creates a TenantOptionsOK with default headers values +func NewTenantOptionsOK() *TenantOptionsOK { + return &TenantOptionsOK{} +} + +/* TenantOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type TenantOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *TenantOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /tenants/observable][%d] tenantOptionsOK ", 200) +} + +func (o *TenantOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/devops/devops_client/cors/tenants_options_parameters.go b/api/devops/devops_client/cors/tenants_options_parameters.go new file mode 100644 index 0000000..85e4bc0 --- /dev/null +++ b/api/devops/devops_client/cors/tenants_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewTenantsOptionsParams creates a new TenantsOptionsParams 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 NewTenantsOptionsParams() *TenantsOptionsParams { + return &TenantsOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenantsOptionsParamsWithTimeout creates a new TenantsOptionsParams object +// with the ability to set a timeout on a request. +func NewTenantsOptionsParamsWithTimeout(timeout time.Duration) *TenantsOptionsParams { + return &TenantsOptionsParams{ + timeout: timeout, + } +} + +// NewTenantsOptionsParamsWithContext creates a new TenantsOptionsParams object +// with the ability to set a context for a request. +func NewTenantsOptionsParamsWithContext(ctx context.Context) *TenantsOptionsParams { + return &TenantsOptionsParams{ + Context: ctx, + } +} + +// NewTenantsOptionsParamsWithHTTPClient creates a new TenantsOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenantsOptionsParamsWithHTTPClient(client *http.Client) *TenantsOptionsParams { + return &TenantsOptionsParams{ + HTTPClient: client, + } +} + +/* TenantsOptionsParams contains all the parameters to send to the API endpoint + for the tenants options operation. + + Typically these are written to a http.Request. +*/ +type TenantsOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenants options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenantsOptionsParams) WithDefaults() *TenantsOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenants options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenantsOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenants options params +func (o *TenantsOptionsParams) WithTimeout(timeout time.Duration) *TenantsOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenants options params +func (o *TenantsOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenants options params +func (o *TenantsOptionsParams) WithContext(ctx context.Context) *TenantsOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenants options params +func (o *TenantsOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenants options params +func (o *TenantsOptionsParams) WithHTTPClient(client *http.Client) *TenantsOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenants options params +func (o *TenantsOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *TenantsOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/cors/tenants_options_responses.go b/api/devops/devops_client/cors/tenants_options_responses.go new file mode 100644 index 0000000..5d1bef2 --- /dev/null +++ b/api/devops/devops_client/cors/tenants_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// TenantsOptionsReader is a Reader for the TenantsOptions structure. +type TenantsOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenantsOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenantsOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewTenantsOptionsOK creates a TenantsOptionsOK with default headers values +func NewTenantsOptionsOK() *TenantsOptionsOK { + return &TenantsOptionsOK{} +} + +/* TenantsOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type TenantsOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *TenantsOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /tenants][%d] tenantsOptionsOK ", 200) +} + +func (o *TenantsOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/devops/devops_client/cors/user_options_parameters.go b/api/devops/devops_client/cors/user_options_parameters.go new file mode 100644 index 0000000..7730414 --- /dev/null +++ b/api/devops/devops_client/cors/user_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewUserOptionsParams creates a new UserOptionsParams 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 NewUserOptionsParams() *UserOptionsParams { + return &UserOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUserOptionsParamsWithTimeout creates a new UserOptionsParams object +// with the ability to set a timeout on a request. +func NewUserOptionsParamsWithTimeout(timeout time.Duration) *UserOptionsParams { + return &UserOptionsParams{ + timeout: timeout, + } +} + +// NewUserOptionsParamsWithContext creates a new UserOptionsParams object +// with the ability to set a context for a request. +func NewUserOptionsParamsWithContext(ctx context.Context) *UserOptionsParams { + return &UserOptionsParams{ + Context: ctx, + } +} + +// NewUserOptionsParamsWithHTTPClient creates a new UserOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewUserOptionsParamsWithHTTPClient(client *http.Client) *UserOptionsParams { + return &UserOptionsParams{ + HTTPClient: client, + } +} + +/* UserOptionsParams contains all the parameters to send to the API endpoint + for the user options operation. + + Typically these are written to a http.Request. +*/ +type UserOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the user options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UserOptionsParams) WithDefaults() *UserOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the user options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UserOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the user options params +func (o *UserOptionsParams) WithTimeout(timeout time.Duration) *UserOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the user options params +func (o *UserOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the user options params +func (o *UserOptionsParams) WithContext(ctx context.Context) *UserOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the user options params +func (o *UserOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the user options params +func (o *UserOptionsParams) WithHTTPClient(client *http.Client) *UserOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the user options params +func (o *UserOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *UserOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/cors/user_options_responses.go b/api/devops/devops_client/cors/user_options_responses.go new file mode 100644 index 0000000..9ce5281 --- /dev/null +++ b/api/devops/devops_client/cors/user_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// UserOptionsReader is a Reader for the UserOptions structure. +type UserOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UserOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUserOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewUserOptionsOK creates a UserOptionsOK with default headers values +func NewUserOptionsOK() *UserOptionsOK { + return &UserOptionsOK{} +} + +/* UserOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type UserOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *UserOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /users/observable][%d] userOptionsOK ", 200) +} + +func (o *UserOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/devops/devops_client/cors/users_options_parameters.go b/api/devops/devops_client/cors/users_options_parameters.go new file mode 100644 index 0000000..887e647 --- /dev/null +++ b/api/devops/devops_client/cors/users_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewUsersOptionsParams creates a new UsersOptionsParams 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 NewUsersOptionsParams() *UsersOptionsParams { + return &UsersOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUsersOptionsParamsWithTimeout creates a new UsersOptionsParams object +// with the ability to set a timeout on a request. +func NewUsersOptionsParamsWithTimeout(timeout time.Duration) *UsersOptionsParams { + return &UsersOptionsParams{ + timeout: timeout, + } +} + +// NewUsersOptionsParamsWithContext creates a new UsersOptionsParams object +// with the ability to set a context for a request. +func NewUsersOptionsParamsWithContext(ctx context.Context) *UsersOptionsParams { + return &UsersOptionsParams{ + Context: ctx, + } +} + +// NewUsersOptionsParamsWithHTTPClient creates a new UsersOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewUsersOptionsParamsWithHTTPClient(client *http.Client) *UsersOptionsParams { + return &UsersOptionsParams{ + HTTPClient: client, + } +} + +/* UsersOptionsParams contains all the parameters to send to the API endpoint + for the users options operation. + + Typically these are written to a http.Request. +*/ +type UsersOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the users options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UsersOptionsParams) WithDefaults() *UsersOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the users options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UsersOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the users options params +func (o *UsersOptionsParams) WithTimeout(timeout time.Duration) *UsersOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the users options params +func (o *UsersOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the users options params +func (o *UsersOptionsParams) WithContext(ctx context.Context) *UsersOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the users options params +func (o *UsersOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the users options params +func (o *UsersOptionsParams) WithHTTPClient(client *http.Client) *UsersOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the users options params +func (o *UsersOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *UsersOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/cors/users_options_responses.go b/api/devops/devops_client/cors/users_options_responses.go new file mode 100644 index 0000000..fdbcefe --- /dev/null +++ b/api/devops/devops_client/cors/users_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// UsersOptionsReader is a Reader for the UsersOptions structure. +type UsersOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UsersOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUsersOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewUsersOptionsOK creates a UsersOptionsOK with default headers values +func NewUsersOptionsOK() *UsersOptionsOK { + return &UsersOptionsOK{} +} + +/* UsersOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type UsersOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *UsersOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /users][%d] usersOptionsOK ", 200) +} + +func (o *UsersOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/devops/devops_client/database/database_client.go b/api/devops/devops_client/database/database_client.go new file mode 100644 index 0000000..6674472 --- /dev/null +++ b/api/devops/devops_client/database/database_client.go @@ -0,0 +1,258 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package database + +// 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 database API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for database 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 { + GetDatabase(params *GetDatabaseParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDatabaseOK, error) + + GetDatabases(params *GetDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDatabasesOK, error) + + GetDatabasesObservable(params *GetDatabasesObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDatabasesObservableOK, error) + + PostDatabases(params *PostDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostDatabasesOK, error) + + PutDatabases(params *PutDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutDatabasesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetDatabase gets a single database object + + Return a single Database object from datastore as a Singleton +*/ +func (a *Client) GetDatabase(params *GetDatabaseParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDatabaseOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetDatabaseParams() + } + op := &runtime.ClientOperation{ + ID: "getDatabase", + Method: "GET", + PathPattern: "/databases/{databaseIdPath}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetDatabaseReader{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.(*GetDatabaseOK) + 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 getDatabase: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetDatabases gets a list databases + + Return a list of Database records from the datastore +*/ +func (a *Client) GetDatabases(params *GetDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDatabasesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetDatabasesParams() + } + op := &runtime.ClientOperation{ + ID: "getDatabases", + Method: "GET", + PathPattern: "/databases", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetDatabasesReader{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.(*GetDatabasesOK) + 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 getDatabases: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetDatabasesObservable gets databases in an observable array + + Returns a Database retrieval in a observable array +*/ +func (a *Client) GetDatabasesObservable(params *GetDatabasesObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDatabasesObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetDatabasesObservableParams() + } + op := &runtime.ClientOperation{ + ID: "getDatabasesObservable", + Method: "GET", + PathPattern: "/databases/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetDatabasesObservableReader{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.(*GetDatabasesObservableOK) + 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 getDatabasesObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostDatabases creates new databases + + Create Databases in Telnexus +*/ +func (a *Client) PostDatabases(params *PostDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostDatabasesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostDatabasesParams() + } + op := &runtime.ClientOperation{ + ID: "postDatabases", + Method: "POST", + PathPattern: "/databases", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostDatabasesReader{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.(*PostDatabasesOK) + 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 postDatabases: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutDatabases updates databases + + Update Database in Telnexus +*/ +func (a *Client) PutDatabases(params *PutDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutDatabasesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutDatabasesParams() + } + op := &runtime.ClientOperation{ + ID: "putDatabases", + Method: "PUT", + PathPattern: "/databases", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutDatabasesReader{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.(*PutDatabasesOK) + 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 putDatabases: 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 +} diff --git a/api/devops/devops_client/database/get_database_parameters.go b/api/devops/devops_client/database/get_database_parameters.go new file mode 100644 index 0000000..e8d3b77 --- /dev/null +++ b/api/devops/devops_client/database/get_database_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package database + +// 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" +) + +// NewGetDatabaseParams creates a new GetDatabaseParams 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 NewGetDatabaseParams() *GetDatabaseParams { + return &GetDatabaseParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetDatabaseParamsWithTimeout creates a new GetDatabaseParams object +// with the ability to set a timeout on a request. +func NewGetDatabaseParamsWithTimeout(timeout time.Duration) *GetDatabaseParams { + return &GetDatabaseParams{ + timeout: timeout, + } +} + +// NewGetDatabaseParamsWithContext creates a new GetDatabaseParams object +// with the ability to set a context for a request. +func NewGetDatabaseParamsWithContext(ctx context.Context) *GetDatabaseParams { + return &GetDatabaseParams{ + Context: ctx, + } +} + +// NewGetDatabaseParamsWithHTTPClient creates a new GetDatabaseParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetDatabaseParamsWithHTTPClient(client *http.Client) *GetDatabaseParams { + return &GetDatabaseParams{ + HTTPClient: client, + } +} + +/* GetDatabaseParams contains all the parameters to send to the API endpoint + for the get database operation. + + Typically these are written to a http.Request. +*/ +type GetDatabaseParams struct { + + /* DatabaseIDPath. + + Telnexus Record Id of a Database + */ + DatabaseIDPath string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get database params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDatabaseParams) WithDefaults() *GetDatabaseParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get database params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDatabaseParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get database params +func (o *GetDatabaseParams) WithTimeout(timeout time.Duration) *GetDatabaseParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get database params +func (o *GetDatabaseParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get database params +func (o *GetDatabaseParams) WithContext(ctx context.Context) *GetDatabaseParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get database params +func (o *GetDatabaseParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get database params +func (o *GetDatabaseParams) WithHTTPClient(client *http.Client) *GetDatabaseParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get database params +func (o *GetDatabaseParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDatabaseIDPath adds the databaseIDPath to the get database params +func (o *GetDatabaseParams) WithDatabaseIDPath(databaseIDPath string) *GetDatabaseParams { + o.SetDatabaseIDPath(databaseIDPath) + return o +} + +// SetDatabaseIDPath adds the databaseIdPath to the get database params +func (o *GetDatabaseParams) SetDatabaseIDPath(databaseIDPath string) { + o.DatabaseIDPath = databaseIDPath +} + +// WriteToRequest writes these params to a swagger request +func (o *GetDatabaseParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param databaseIdPath + if err := r.SetPathParam("databaseIdPath", o.DatabaseIDPath); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/database/get_database_responses.go b/api/devops/devops_client/database/get_database_responses.go new file mode 100644 index 0000000..60cb777 --- /dev/null +++ b/api/devops/devops_client/database/get_database_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package database + +// 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/telnexus/lib/api/devops/devops_models" +) + +// GetDatabaseReader is a Reader for the GetDatabase structure. +type GetDatabaseReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetDatabaseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetDatabaseOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetDatabaseUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetDatabaseForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetDatabaseNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetDatabaseUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetDatabaseInternalServerError() + 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()) + } +} + +// NewGetDatabaseOK creates a GetDatabaseOK with default headers values +func NewGetDatabaseOK() *GetDatabaseOK { + return &GetDatabaseOK{} +} + +/* GetDatabaseOK describes a response with status code 200, with default header values. + +Single Database record response +*/ +type GetDatabaseOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Database +} + +func (o *GetDatabaseOK) Error() string { + return fmt.Sprintf("[GET /databases/{databaseIdPath}][%d] getDatabaseOK %+v", 200, o.Payload) +} +func (o *GetDatabaseOK) GetPayload() *devops_models.Database { + return o.Payload +} + +func (o *GetDatabaseOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Database) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDatabaseUnauthorized creates a GetDatabaseUnauthorized with default headers values +func NewGetDatabaseUnauthorized() *GetDatabaseUnauthorized { + return &GetDatabaseUnauthorized{} +} + +/* GetDatabaseUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetDatabaseUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetDatabaseUnauthorized) Error() string { + return fmt.Sprintf("[GET /databases/{databaseIdPath}][%d] getDatabaseUnauthorized %+v", 401, o.Payload) +} +func (o *GetDatabaseUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetDatabaseUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDatabaseForbidden creates a GetDatabaseForbidden with default headers values +func NewGetDatabaseForbidden() *GetDatabaseForbidden { + return &GetDatabaseForbidden{} +} + +/* GetDatabaseForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetDatabaseForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetDatabaseForbidden) Error() string { + return fmt.Sprintf("[GET /databases/{databaseIdPath}][%d] getDatabaseForbidden %+v", 403, o.Payload) +} +func (o *GetDatabaseForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetDatabaseForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDatabaseNotFound creates a GetDatabaseNotFound with default headers values +func NewGetDatabaseNotFound() *GetDatabaseNotFound { + return &GetDatabaseNotFound{} +} + +/* GetDatabaseNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetDatabaseNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetDatabaseNotFound) Error() string { + return fmt.Sprintf("[GET /databases/{databaseIdPath}][%d] getDatabaseNotFound %+v", 404, o.Payload) +} +func (o *GetDatabaseNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetDatabaseNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDatabaseUnprocessableEntity creates a GetDatabaseUnprocessableEntity with default headers values +func NewGetDatabaseUnprocessableEntity() *GetDatabaseUnprocessableEntity { + return &GetDatabaseUnprocessableEntity{} +} + +/* GetDatabaseUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetDatabaseUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetDatabaseUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /databases/{databaseIdPath}][%d] getDatabaseUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetDatabaseUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetDatabaseUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDatabaseInternalServerError creates a GetDatabaseInternalServerError with default headers values +func NewGetDatabaseInternalServerError() *GetDatabaseInternalServerError { + return &GetDatabaseInternalServerError{} +} + +/* GetDatabaseInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetDatabaseInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetDatabaseInternalServerError) Error() string { + return fmt.Sprintf("[GET /databases/{databaseIdPath}][%d] getDatabaseInternalServerError %+v", 500, o.Payload) +} +func (o *GetDatabaseInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetDatabaseInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/database/get_databases_observable_parameters.go b/api/devops/devops_client/database/get_databases_observable_parameters.go new file mode 100644 index 0000000..4fe44d6 --- /dev/null +++ b/api/devops/devops_client/database/get_databases_observable_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package database + +// 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" +) + +// NewGetDatabasesObservableParams creates a new GetDatabasesObservableParams 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 NewGetDatabasesObservableParams() *GetDatabasesObservableParams { + return &GetDatabasesObservableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetDatabasesObservableParamsWithTimeout creates a new GetDatabasesObservableParams object +// with the ability to set a timeout on a request. +func NewGetDatabasesObservableParamsWithTimeout(timeout time.Duration) *GetDatabasesObservableParams { + return &GetDatabasesObservableParams{ + timeout: timeout, + } +} + +// NewGetDatabasesObservableParamsWithContext creates a new GetDatabasesObservableParams object +// with the ability to set a context for a request. +func NewGetDatabasesObservableParamsWithContext(ctx context.Context) *GetDatabasesObservableParams { + return &GetDatabasesObservableParams{ + Context: ctx, + } +} + +// NewGetDatabasesObservableParamsWithHTTPClient creates a new GetDatabasesObservableParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetDatabasesObservableParamsWithHTTPClient(client *http.Client) *GetDatabasesObservableParams { + return &GetDatabasesObservableParams{ + HTTPClient: client, + } +} + +/* GetDatabasesObservableParams contains all the parameters to send to the API endpoint + for the get databases observable operation. + + Typically these are written to a http.Request. +*/ +type GetDatabasesObservableParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get databases observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDatabasesObservableParams) WithDefaults() *GetDatabasesObservableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get databases observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDatabasesObservableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get databases observable params +func (o *GetDatabasesObservableParams) WithTimeout(timeout time.Duration) *GetDatabasesObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get databases observable params +func (o *GetDatabasesObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get databases observable params +func (o *GetDatabasesObservableParams) WithContext(ctx context.Context) *GetDatabasesObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get databases observable params +func (o *GetDatabasesObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get databases observable params +func (o *GetDatabasesObservableParams) WithHTTPClient(client *http.Client) *GetDatabasesObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get databases observable params +func (o *GetDatabasesObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetDatabasesObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/database/get_databases_observable_responses.go b/api/devops/devops_client/database/get_databases_observable_responses.go new file mode 100644 index 0000000..ee93906 --- /dev/null +++ b/api/devops/devops_client/database/get_databases_observable_responses.go @@ -0,0 +1,337 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package database + +// 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/telnexus/lib/api/devops/devops_models" +) + +// GetDatabasesObservableReader is a Reader for the GetDatabasesObservable structure. +type GetDatabasesObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetDatabasesObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetDatabasesObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetDatabasesObservableUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetDatabasesObservableForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetDatabasesObservableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetDatabasesObservableUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetDatabasesObservableInternalServerError() + 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()) + } +} + +// NewGetDatabasesObservableOK creates a GetDatabasesObservableOK with default headers values +func NewGetDatabasesObservableOK() *GetDatabasesObservableOK { + return &GetDatabasesObservableOK{} +} + +/* GetDatabasesObservableOK describes a response with status code 200, with default header values. + +Single Database record response +*/ +type GetDatabasesObservableOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload []*devops_models.Database +} + +func (o *GetDatabasesObservableOK) Error() string { + return fmt.Sprintf("[GET /databases/observable][%d] getDatabasesObservableOK %+v", 200, o.Payload) +} +func (o *GetDatabasesObservableOK) GetPayload() []*devops_models.Database { + return o.Payload +} + +func (o *GetDatabasesObservableOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDatabasesObservableUnauthorized creates a GetDatabasesObservableUnauthorized with default headers values +func NewGetDatabasesObservableUnauthorized() *GetDatabasesObservableUnauthorized { + return &GetDatabasesObservableUnauthorized{} +} + +/* GetDatabasesObservableUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetDatabasesObservableUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetDatabasesObservableUnauthorized) Error() string { + return fmt.Sprintf("[GET /databases/observable][%d] getDatabasesObservableUnauthorized %+v", 401, o.Payload) +} +func (o *GetDatabasesObservableUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetDatabasesObservableUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDatabasesObservableForbidden creates a GetDatabasesObservableForbidden with default headers values +func NewGetDatabasesObservableForbidden() *GetDatabasesObservableForbidden { + return &GetDatabasesObservableForbidden{} +} + +/* GetDatabasesObservableForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetDatabasesObservableForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetDatabasesObservableForbidden) Error() string { + return fmt.Sprintf("[GET /databases/observable][%d] getDatabasesObservableForbidden %+v", 403, o.Payload) +} +func (o *GetDatabasesObservableForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetDatabasesObservableForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDatabasesObservableNotFound creates a GetDatabasesObservableNotFound with default headers values +func NewGetDatabasesObservableNotFound() *GetDatabasesObservableNotFound { + return &GetDatabasesObservableNotFound{} +} + +/* GetDatabasesObservableNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetDatabasesObservableNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetDatabasesObservableNotFound) Error() string { + return fmt.Sprintf("[GET /databases/observable][%d] getDatabasesObservableNotFound %+v", 404, o.Payload) +} +func (o *GetDatabasesObservableNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetDatabasesObservableNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDatabasesObservableUnprocessableEntity creates a GetDatabasesObservableUnprocessableEntity with default headers values +func NewGetDatabasesObservableUnprocessableEntity() *GetDatabasesObservableUnprocessableEntity { + return &GetDatabasesObservableUnprocessableEntity{} +} + +/* GetDatabasesObservableUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetDatabasesObservableUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetDatabasesObservableUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /databases/observable][%d] getDatabasesObservableUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetDatabasesObservableUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetDatabasesObservableUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDatabasesObservableInternalServerError creates a GetDatabasesObservableInternalServerError with default headers values +func NewGetDatabasesObservableInternalServerError() *GetDatabasesObservableInternalServerError { + return &GetDatabasesObservableInternalServerError{} +} + +/* GetDatabasesObservableInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetDatabasesObservableInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetDatabasesObservableInternalServerError) Error() string { + return fmt.Sprintf("[GET /databases/observable][%d] getDatabasesObservableInternalServerError %+v", 500, o.Payload) +} +func (o *GetDatabasesObservableInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetDatabasesObservableInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/database/get_databases_parameters.go b/api/devops/devops_client/database/get_databases_parameters.go new file mode 100644 index 0000000..fe2f734 --- /dev/null +++ b/api/devops/devops_client/database/get_databases_parameters.go @@ -0,0 +1,272 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package database + +// 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" +) + +// NewGetDatabasesParams creates a new GetDatabasesParams 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 NewGetDatabasesParams() *GetDatabasesParams { + return &GetDatabasesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetDatabasesParamsWithTimeout creates a new GetDatabasesParams object +// with the ability to set a timeout on a request. +func NewGetDatabasesParamsWithTimeout(timeout time.Duration) *GetDatabasesParams { + return &GetDatabasesParams{ + timeout: timeout, + } +} + +// NewGetDatabasesParamsWithContext creates a new GetDatabasesParams object +// with the ability to set a context for a request. +func NewGetDatabasesParamsWithContext(ctx context.Context) *GetDatabasesParams { + return &GetDatabasesParams{ + Context: ctx, + } +} + +// NewGetDatabasesParamsWithHTTPClient creates a new GetDatabasesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetDatabasesParamsWithHTTPClient(client *http.Client) *GetDatabasesParams { + return &GetDatabasesParams{ + HTTPClient: client, + } +} + +/* GetDatabasesParams contains all the parameters to send to the API endpoint + for the get databases operation. + + Typically these are written to a http.Request. +*/ +type GetDatabasesParams struct { + + /* CompanyID. + + Telnexus Record Id of a Company + */ + CompanyID *string + + /* DatabaseID. + + Telnexus Record Id of a Database + */ + DatabaseID *string + + /* Limit. + + How many objects to return at one time + + Format: int64 + */ + Limit *int64 + + /* Offset. + + How many objects to skip? (default 0) + + Format: int64 + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get databases params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDatabasesParams) WithDefaults() *GetDatabasesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get databases params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDatabasesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get databases params +func (o *GetDatabasesParams) WithTimeout(timeout time.Duration) *GetDatabasesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get databases params +func (o *GetDatabasesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get databases params +func (o *GetDatabasesParams) WithContext(ctx context.Context) *GetDatabasesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get databases params +func (o *GetDatabasesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get databases params +func (o *GetDatabasesParams) WithHTTPClient(client *http.Client) *GetDatabasesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get databases params +func (o *GetDatabasesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCompanyID adds the companyID to the get databases params +func (o *GetDatabasesParams) WithCompanyID(companyID *string) *GetDatabasesParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get databases params +func (o *GetDatabasesParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WithDatabaseID adds the databaseID to the get databases params +func (o *GetDatabasesParams) WithDatabaseID(databaseID *string) *GetDatabasesParams { + o.SetDatabaseID(databaseID) + return o +} + +// SetDatabaseID adds the databaseId to the get databases params +func (o *GetDatabasesParams) SetDatabaseID(databaseID *string) { + o.DatabaseID = databaseID +} + +// WithLimit adds the limit to the get databases params +func (o *GetDatabasesParams) WithLimit(limit *int64) *GetDatabasesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get databases params +func (o *GetDatabasesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get databases params +func (o *GetDatabasesParams) WithOffset(offset *int64) *GetDatabasesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get databases params +func (o *GetDatabasesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetDatabasesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CompanyID != nil { + + // query param companyId + var qrCompanyID string + + if o.CompanyID != nil { + qrCompanyID = *o.CompanyID + } + qCompanyID := qrCompanyID + if qCompanyID != "" { + + if err := r.SetQueryParam("companyId", qCompanyID); err != nil { + return err + } + } + } + + if o.DatabaseID != nil { + + // query param databaseId + var qrDatabaseID string + + if o.DatabaseID != nil { + qrDatabaseID = *o.DatabaseID + } + qDatabaseID := qrDatabaseID + if qDatabaseID != "" { + + if err := r.SetQueryParam("databaseId", qDatabaseID); 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 +} diff --git a/api/devops/devops_client/database/get_databases_responses.go b/api/devops/devops_client/database/get_databases_responses.go new file mode 100644 index 0000000..e7a918b --- /dev/null +++ b/api/devops/devops_client/database/get_databases_responses.go @@ -0,0 +1,331 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package database + +// 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/telnexus/lib/api/devops/devops_models" +) + +// GetDatabasesReader is a Reader for the GetDatabases structure. +type GetDatabasesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetDatabasesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetDatabasesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetDatabasesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetDatabasesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetDatabasesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetDatabasesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetDatabasesInternalServerError() + 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()) + } +} + +// NewGetDatabasesOK creates a GetDatabasesOK with default headers values +func NewGetDatabasesOK() *GetDatabasesOK { + return &GetDatabasesOK{} +} + +/* GetDatabasesOK describes a response with status code 200, with default header values. + +Telnexus Response with Database objects +*/ +type GetDatabasesOK struct { + AccessControlAllowOrigin string + + Payload *devops_models.DatabaseResponse +} + +func (o *GetDatabasesOK) Error() string { + return fmt.Sprintf("[GET /databases][%d] getDatabasesOK %+v", 200, o.Payload) +} +func (o *GetDatabasesOK) GetPayload() *devops_models.DatabaseResponse { + return o.Payload +} + +func (o *GetDatabasesOK) 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(devops_models.DatabaseResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDatabasesUnauthorized creates a GetDatabasesUnauthorized with default headers values +func NewGetDatabasesUnauthorized() *GetDatabasesUnauthorized { + return &GetDatabasesUnauthorized{} +} + +/* GetDatabasesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetDatabasesUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetDatabasesUnauthorized) Error() string { + return fmt.Sprintf("[GET /databases][%d] getDatabasesUnauthorized %+v", 401, o.Payload) +} +func (o *GetDatabasesUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetDatabasesUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDatabasesForbidden creates a GetDatabasesForbidden with default headers values +func NewGetDatabasesForbidden() *GetDatabasesForbidden { + return &GetDatabasesForbidden{} +} + +/* GetDatabasesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetDatabasesForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetDatabasesForbidden) Error() string { + return fmt.Sprintf("[GET /databases][%d] getDatabasesForbidden %+v", 403, o.Payload) +} +func (o *GetDatabasesForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetDatabasesForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDatabasesNotFound creates a GetDatabasesNotFound with default headers values +func NewGetDatabasesNotFound() *GetDatabasesNotFound { + return &GetDatabasesNotFound{} +} + +/* GetDatabasesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetDatabasesNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetDatabasesNotFound) Error() string { + return fmt.Sprintf("[GET /databases][%d] getDatabasesNotFound %+v", 404, o.Payload) +} +func (o *GetDatabasesNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetDatabasesNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDatabasesUnprocessableEntity creates a GetDatabasesUnprocessableEntity with default headers values +func NewGetDatabasesUnprocessableEntity() *GetDatabasesUnprocessableEntity { + return &GetDatabasesUnprocessableEntity{} +} + +/* GetDatabasesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetDatabasesUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetDatabasesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /databases][%d] getDatabasesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetDatabasesUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetDatabasesUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDatabasesInternalServerError creates a GetDatabasesInternalServerError with default headers values +func NewGetDatabasesInternalServerError() *GetDatabasesInternalServerError { + return &GetDatabasesInternalServerError{} +} + +/* GetDatabasesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetDatabasesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetDatabasesInternalServerError) Error() string { + return fmt.Sprintf("[GET /databases][%d] getDatabasesInternalServerError %+v", 500, o.Payload) +} +func (o *GetDatabasesInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetDatabasesInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/database/post_databases_parameters.go b/api/devops/devops_client/database/post_databases_parameters.go new file mode 100644 index 0000000..8a105e6 --- /dev/null +++ b/api/devops/devops_client/database/post_databases_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package database + +// 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/telnexus/lib/api/devops/devops_models" +) + +// NewPostDatabasesParams creates a new PostDatabasesParams 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 NewPostDatabasesParams() *PostDatabasesParams { + return &PostDatabasesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostDatabasesParamsWithTimeout creates a new PostDatabasesParams object +// with the ability to set a timeout on a request. +func NewPostDatabasesParamsWithTimeout(timeout time.Duration) *PostDatabasesParams { + return &PostDatabasesParams{ + timeout: timeout, + } +} + +// NewPostDatabasesParamsWithContext creates a new PostDatabasesParams object +// with the ability to set a context for a request. +func NewPostDatabasesParamsWithContext(ctx context.Context) *PostDatabasesParams { + return &PostDatabasesParams{ + Context: ctx, + } +} + +// NewPostDatabasesParamsWithHTTPClient creates a new PostDatabasesParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostDatabasesParamsWithHTTPClient(client *http.Client) *PostDatabasesParams { + return &PostDatabasesParams{ + HTTPClient: client, + } +} + +/* PostDatabasesParams contains all the parameters to send to the API endpoint + for the post databases operation. + + Typically these are written to a http.Request. +*/ +type PostDatabasesParams struct { + + /* DatabaseRequest. + + An array of Database records + */ + DatabaseRequest *devops_models.DatabaseRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post databases params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostDatabasesParams) WithDefaults() *PostDatabasesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post databases params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostDatabasesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post databases params +func (o *PostDatabasesParams) WithTimeout(timeout time.Duration) *PostDatabasesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post databases params +func (o *PostDatabasesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post databases params +func (o *PostDatabasesParams) WithContext(ctx context.Context) *PostDatabasesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post databases params +func (o *PostDatabasesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post databases params +func (o *PostDatabasesParams) WithHTTPClient(client *http.Client) *PostDatabasesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post databases params +func (o *PostDatabasesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDatabaseRequest adds the databaseRequest to the post databases params +func (o *PostDatabasesParams) WithDatabaseRequest(databaseRequest *devops_models.DatabaseRequest) *PostDatabasesParams { + o.SetDatabaseRequest(databaseRequest) + return o +} + +// SetDatabaseRequest adds the databaseRequest to the post databases params +func (o *PostDatabasesParams) SetDatabaseRequest(databaseRequest *devops_models.DatabaseRequest) { + o.DatabaseRequest = databaseRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostDatabasesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.DatabaseRequest != nil { + if err := r.SetBodyParam(o.DatabaseRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/database/post_databases_responses.go b/api/devops/devops_client/database/post_databases_responses.go new file mode 100644 index 0000000..31dfd8b --- /dev/null +++ b/api/devops/devops_client/database/post_databases_responses.go @@ -0,0 +1,331 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package database + +// 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/telnexus/lib/api/devops/devops_models" +) + +// PostDatabasesReader is a Reader for the PostDatabases structure. +type PostDatabasesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostDatabasesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostDatabasesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostDatabasesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostDatabasesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostDatabasesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostDatabasesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostDatabasesInternalServerError() + 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()) + } +} + +// NewPostDatabasesOK creates a PostDatabasesOK with default headers values +func NewPostDatabasesOK() *PostDatabasesOK { + return &PostDatabasesOK{} +} + +/* PostDatabasesOK describes a response with status code 200, with default header values. + +Telnexus Response with Database objects +*/ +type PostDatabasesOK struct { + AccessControlAllowOrigin string + + Payload *devops_models.DatabaseResponse +} + +func (o *PostDatabasesOK) Error() string { + return fmt.Sprintf("[POST /databases][%d] postDatabasesOK %+v", 200, o.Payload) +} +func (o *PostDatabasesOK) GetPayload() *devops_models.DatabaseResponse { + return o.Payload +} + +func (o *PostDatabasesOK) 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(devops_models.DatabaseResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostDatabasesUnauthorized creates a PostDatabasesUnauthorized with default headers values +func NewPostDatabasesUnauthorized() *PostDatabasesUnauthorized { + return &PostDatabasesUnauthorized{} +} + +/* PostDatabasesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostDatabasesUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PostDatabasesUnauthorized) Error() string { + return fmt.Sprintf("[POST /databases][%d] postDatabasesUnauthorized %+v", 401, o.Payload) +} +func (o *PostDatabasesUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostDatabasesUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostDatabasesForbidden creates a PostDatabasesForbidden with default headers values +func NewPostDatabasesForbidden() *PostDatabasesForbidden { + return &PostDatabasesForbidden{} +} + +/* PostDatabasesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostDatabasesForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostDatabasesForbidden) Error() string { + return fmt.Sprintf("[POST /databases][%d] postDatabasesForbidden %+v", 403, o.Payload) +} +func (o *PostDatabasesForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostDatabasesForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostDatabasesNotFound creates a PostDatabasesNotFound with default headers values +func NewPostDatabasesNotFound() *PostDatabasesNotFound { + return &PostDatabasesNotFound{} +} + +/* PostDatabasesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostDatabasesNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostDatabasesNotFound) Error() string { + return fmt.Sprintf("[POST /databases][%d] postDatabasesNotFound %+v", 404, o.Payload) +} +func (o *PostDatabasesNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostDatabasesNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostDatabasesUnprocessableEntity creates a PostDatabasesUnprocessableEntity with default headers values +func NewPostDatabasesUnprocessableEntity() *PostDatabasesUnprocessableEntity { + return &PostDatabasesUnprocessableEntity{} +} + +/* PostDatabasesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostDatabasesUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PostDatabasesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /databases][%d] postDatabasesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PostDatabasesUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostDatabasesUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostDatabasesInternalServerError creates a PostDatabasesInternalServerError with default headers values +func NewPostDatabasesInternalServerError() *PostDatabasesInternalServerError { + return &PostDatabasesInternalServerError{} +} + +/* PostDatabasesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostDatabasesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostDatabasesInternalServerError) Error() string { + return fmt.Sprintf("[POST /databases][%d] postDatabasesInternalServerError %+v", 500, o.Payload) +} +func (o *PostDatabasesInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostDatabasesInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/database/put_databases_parameters.go b/api/devops/devops_client/database/put_databases_parameters.go new file mode 100644 index 0000000..7ab986e --- /dev/null +++ b/api/devops/devops_client/database/put_databases_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package database + +// 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/telnexus/lib/api/devops/devops_models" +) + +// NewPutDatabasesParams creates a new PutDatabasesParams 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 NewPutDatabasesParams() *PutDatabasesParams { + return &PutDatabasesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPutDatabasesParamsWithTimeout creates a new PutDatabasesParams object +// with the ability to set a timeout on a request. +func NewPutDatabasesParamsWithTimeout(timeout time.Duration) *PutDatabasesParams { + return &PutDatabasesParams{ + timeout: timeout, + } +} + +// NewPutDatabasesParamsWithContext creates a new PutDatabasesParams object +// with the ability to set a context for a request. +func NewPutDatabasesParamsWithContext(ctx context.Context) *PutDatabasesParams { + return &PutDatabasesParams{ + Context: ctx, + } +} + +// NewPutDatabasesParamsWithHTTPClient creates a new PutDatabasesParams object +// with the ability to set a custom HTTPClient for a request. +func NewPutDatabasesParamsWithHTTPClient(client *http.Client) *PutDatabasesParams { + return &PutDatabasesParams{ + HTTPClient: client, + } +} + +/* PutDatabasesParams contains all the parameters to send to the API endpoint + for the put databases operation. + + Typically these are written to a http.Request. +*/ +type PutDatabasesParams struct { + + /* DatabaseRequest. + + An array of Database records + */ + DatabaseRequest *devops_models.DatabaseRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put databases params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutDatabasesParams) WithDefaults() *PutDatabasesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put databases params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutDatabasesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the put databases params +func (o *PutDatabasesParams) WithTimeout(timeout time.Duration) *PutDatabasesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put databases params +func (o *PutDatabasesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put databases params +func (o *PutDatabasesParams) WithContext(ctx context.Context) *PutDatabasesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put databases params +func (o *PutDatabasesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put databases params +func (o *PutDatabasesParams) WithHTTPClient(client *http.Client) *PutDatabasesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put databases params +func (o *PutDatabasesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDatabaseRequest adds the databaseRequest to the put databases params +func (o *PutDatabasesParams) WithDatabaseRequest(databaseRequest *devops_models.DatabaseRequest) *PutDatabasesParams { + o.SetDatabaseRequest(databaseRequest) + return o +} + +// SetDatabaseRequest adds the databaseRequest to the put databases params +func (o *PutDatabasesParams) SetDatabaseRequest(databaseRequest *devops_models.DatabaseRequest) { + o.DatabaseRequest = databaseRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutDatabasesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.DatabaseRequest != nil { + if err := r.SetBodyParam(o.DatabaseRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/database/put_databases_responses.go b/api/devops/devops_client/database/put_databases_responses.go new file mode 100644 index 0000000..1b42a9a --- /dev/null +++ b/api/devops/devops_client/database/put_databases_responses.go @@ -0,0 +1,331 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package database + +// 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/telnexus/lib/api/devops/devops_models" +) + +// PutDatabasesReader is a Reader for the PutDatabases structure. +type PutDatabasesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutDatabasesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutDatabasesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutDatabasesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutDatabasesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutDatabasesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutDatabasesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutDatabasesInternalServerError() + 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()) + } +} + +// NewPutDatabasesOK creates a PutDatabasesOK with default headers values +func NewPutDatabasesOK() *PutDatabasesOK { + return &PutDatabasesOK{} +} + +/* PutDatabasesOK describes a response with status code 200, with default header values. + +Telnexus Response with Database objects +*/ +type PutDatabasesOK struct { + AccessControlAllowOrigin string + + Payload *devops_models.DatabaseResponse +} + +func (o *PutDatabasesOK) Error() string { + return fmt.Sprintf("[PUT /databases][%d] putDatabasesOK %+v", 200, o.Payload) +} +func (o *PutDatabasesOK) GetPayload() *devops_models.DatabaseResponse { + return o.Payload +} + +func (o *PutDatabasesOK) 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(devops_models.DatabaseResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutDatabasesUnauthorized creates a PutDatabasesUnauthorized with default headers values +func NewPutDatabasesUnauthorized() *PutDatabasesUnauthorized { + return &PutDatabasesUnauthorized{} +} + +/* PutDatabasesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutDatabasesUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PutDatabasesUnauthorized) Error() string { + return fmt.Sprintf("[PUT /databases][%d] putDatabasesUnauthorized %+v", 401, o.Payload) +} +func (o *PutDatabasesUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutDatabasesUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutDatabasesForbidden creates a PutDatabasesForbidden with default headers values +func NewPutDatabasesForbidden() *PutDatabasesForbidden { + return &PutDatabasesForbidden{} +} + +/* PutDatabasesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PutDatabasesForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PutDatabasesForbidden) Error() string { + return fmt.Sprintf("[PUT /databases][%d] putDatabasesForbidden %+v", 403, o.Payload) +} +func (o *PutDatabasesForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutDatabasesForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutDatabasesNotFound creates a PutDatabasesNotFound with default headers values +func NewPutDatabasesNotFound() *PutDatabasesNotFound { + return &PutDatabasesNotFound{} +} + +/* PutDatabasesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PutDatabasesNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PutDatabasesNotFound) Error() string { + return fmt.Sprintf("[PUT /databases][%d] putDatabasesNotFound %+v", 404, o.Payload) +} +func (o *PutDatabasesNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutDatabasesNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutDatabasesUnprocessableEntity creates a PutDatabasesUnprocessableEntity with default headers values +func NewPutDatabasesUnprocessableEntity() *PutDatabasesUnprocessableEntity { + return &PutDatabasesUnprocessableEntity{} +} + +/* PutDatabasesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutDatabasesUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PutDatabasesUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /databases][%d] putDatabasesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PutDatabasesUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutDatabasesUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutDatabasesInternalServerError creates a PutDatabasesInternalServerError with default headers values +func NewPutDatabasesInternalServerError() *PutDatabasesInternalServerError { + return &PutDatabasesInternalServerError{} +} + +/* PutDatabasesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PutDatabasesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PutDatabasesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /databases][%d] putDatabasesInternalServerError %+v", 500, o.Payload) +} +func (o *PutDatabasesInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutDatabasesInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/devops_client.go b/api/devops/devops_client/devops_client.go new file mode 100644 index 0000000..217718e --- /dev/null +++ b/api/devops/devops_client/devops_client.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_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" + + "code.tnxs.net/telnexus/lib/api/devops/devops_client/cluster" + "code.tnxs.net/telnexus/lib/api/devops/devops_client/cors" + "code.tnxs.net/telnexus/lib/api/devops/devops_client/database" + "code.tnxs.net/telnexus/lib/api/devops/devops_client/ingest" + "code.tnxs.net/telnexus/lib/api/devops/devops_client/job" + "code.tnxs.net/telnexus/lib/api/devops/devops_client/service" + "code.tnxs.net/telnexus/lib/api/devops/devops_client/template" + "code.tnxs.net/telnexus/lib/api/devops/devops_client/tenant" + "code.tnxs.net/telnexus/lib/api/devops/devops_client/user" +) + +// Default devops HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "devops.infra.tnxs.net:8080" + // 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 +var DefaultSchemes = []string{"http"} + +// NewHTTPClient creates a new devops HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Devops { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new devops HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Devops { + // ensure nullable parameters have default + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new devops client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Devops { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Devops) + cli.Transport = transport + cli.Cluster = cluster.New(transport, formats) + cli.Cors = cors.New(transport, formats) + cli.Database = database.New(transport, formats) + cli.Ingest = ingest.New(transport, formats) + cli.Job = job.New(transport, formats) + cli.Service = service.New(transport, formats) + cli.Template = template.New(transport, formats) + cli.Tenant = tenant.New(transport, formats) + cli.User = user.New(transport, formats) + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// Devops is a client for devops +type Devops struct { + Cluster cluster.ClientService + + Cors cors.ClientService + + Database database.ClientService + + Ingest ingest.ClientService + + Job job.ClientService + + Service service.ClientService + + Template template.ClientService + + Tenant tenant.ClientService + + User user.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Devops) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.Cluster.SetTransport(transport) + c.Cors.SetTransport(transport) + c.Database.SetTransport(transport) + c.Ingest.SetTransport(transport) + c.Job.SetTransport(transport) + c.Service.SetTransport(transport) + c.Template.SetTransport(transport) + c.Tenant.SetTransport(transport) + c.User.SetTransport(transport) +} diff --git a/api/devops/devops_client/ingest/get_ingest_parameters.go b/api/devops/devops_client/ingest/get_ingest_parameters.go new file mode 100644 index 0000000..3c60393 --- /dev/null +++ b/api/devops/devops_client/ingest/get_ingest_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ingest + +// 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" +) + +// NewGetIngestParams creates a new GetIngestParams 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 NewGetIngestParams() *GetIngestParams { + return &GetIngestParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetIngestParamsWithTimeout creates a new GetIngestParams object +// with the ability to set a timeout on a request. +func NewGetIngestParamsWithTimeout(timeout time.Duration) *GetIngestParams { + return &GetIngestParams{ + timeout: timeout, + } +} + +// NewGetIngestParamsWithContext creates a new GetIngestParams object +// with the ability to set a context for a request. +func NewGetIngestParamsWithContext(ctx context.Context) *GetIngestParams { + return &GetIngestParams{ + Context: ctx, + } +} + +// NewGetIngestParamsWithHTTPClient creates a new GetIngestParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetIngestParamsWithHTTPClient(client *http.Client) *GetIngestParams { + return &GetIngestParams{ + HTTPClient: client, + } +} + +/* GetIngestParams contains all the parameters to send to the API endpoint + for the get ingest operation. + + Typically these are written to a http.Request. +*/ +type GetIngestParams struct { + + /* IngestIDPath. + + Telnexus Record Id of a Ingest + */ + IngestIDPath string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get ingest params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIngestParams) WithDefaults() *GetIngestParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get ingest params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIngestParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get ingest params +func (o *GetIngestParams) WithTimeout(timeout time.Duration) *GetIngestParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get ingest params +func (o *GetIngestParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get ingest params +func (o *GetIngestParams) WithContext(ctx context.Context) *GetIngestParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get ingest params +func (o *GetIngestParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get ingest params +func (o *GetIngestParams) WithHTTPClient(client *http.Client) *GetIngestParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get ingest params +func (o *GetIngestParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIngestIDPath adds the ingestIDPath to the get ingest params +func (o *GetIngestParams) WithIngestIDPath(ingestIDPath string) *GetIngestParams { + o.SetIngestIDPath(ingestIDPath) + return o +} + +// SetIngestIDPath adds the ingestIdPath to the get ingest params +func (o *GetIngestParams) SetIngestIDPath(ingestIDPath string) { + o.IngestIDPath = ingestIDPath +} + +// WriteToRequest writes these params to a swagger request +func (o *GetIngestParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param ingestIdPath + if err := r.SetPathParam("ingestIdPath", o.IngestIDPath); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/ingest/get_ingest_responses.go b/api/devops/devops_client/ingest/get_ingest_responses.go new file mode 100644 index 0000000..00d1654 --- /dev/null +++ b/api/devops/devops_client/ingest/get_ingest_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ingest + +// 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/telnexus/lib/api/devops/devops_models" +) + +// GetIngestReader is a Reader for the GetIngest structure. +type GetIngestReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetIngestReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetIngestOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetIngestUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetIngestForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetIngestNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetIngestUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetIngestInternalServerError() + 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()) + } +} + +// NewGetIngestOK creates a GetIngestOK with default headers values +func NewGetIngestOK() *GetIngestOK { + return &GetIngestOK{} +} + +/* GetIngestOK describes a response with status code 200, with default header values. + +Single Ingest record response +*/ +type GetIngestOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Ingest +} + +func (o *GetIngestOK) Error() string { + return fmt.Sprintf("[GET /ingests/{ingestIdPath}][%d] getIngestOK %+v", 200, o.Payload) +} +func (o *GetIngestOK) GetPayload() *devops_models.Ingest { + return o.Payload +} + +func (o *GetIngestOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Ingest) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetIngestUnauthorized creates a GetIngestUnauthorized with default headers values +func NewGetIngestUnauthorized() *GetIngestUnauthorized { + return &GetIngestUnauthorized{} +} + +/* GetIngestUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetIngestUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetIngestUnauthorized) Error() string { + return fmt.Sprintf("[GET /ingests/{ingestIdPath}][%d] getIngestUnauthorized %+v", 401, o.Payload) +} +func (o *GetIngestUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetIngestUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetIngestForbidden creates a GetIngestForbidden with default headers values +func NewGetIngestForbidden() *GetIngestForbidden { + return &GetIngestForbidden{} +} + +/* GetIngestForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetIngestForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetIngestForbidden) Error() string { + return fmt.Sprintf("[GET /ingests/{ingestIdPath}][%d] getIngestForbidden %+v", 403, o.Payload) +} +func (o *GetIngestForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetIngestForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetIngestNotFound creates a GetIngestNotFound with default headers values +func NewGetIngestNotFound() *GetIngestNotFound { + return &GetIngestNotFound{} +} + +/* GetIngestNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetIngestNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetIngestNotFound) Error() string { + return fmt.Sprintf("[GET /ingests/{ingestIdPath}][%d] getIngestNotFound %+v", 404, o.Payload) +} +func (o *GetIngestNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetIngestNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetIngestUnprocessableEntity creates a GetIngestUnprocessableEntity with default headers values +func NewGetIngestUnprocessableEntity() *GetIngestUnprocessableEntity { + return &GetIngestUnprocessableEntity{} +} + +/* GetIngestUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetIngestUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetIngestUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /ingests/{ingestIdPath}][%d] getIngestUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetIngestUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetIngestUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetIngestInternalServerError creates a GetIngestInternalServerError with default headers values +func NewGetIngestInternalServerError() *GetIngestInternalServerError { + return &GetIngestInternalServerError{} +} + +/* GetIngestInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetIngestInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetIngestInternalServerError) Error() string { + return fmt.Sprintf("[GET /ingests/{ingestIdPath}][%d] getIngestInternalServerError %+v", 500, o.Payload) +} +func (o *GetIngestInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetIngestInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/ingest/get_ingests_observable_parameters.go b/api/devops/devops_client/ingest/get_ingests_observable_parameters.go new file mode 100644 index 0000000..49ba2af --- /dev/null +++ b/api/devops/devops_client/ingest/get_ingests_observable_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ingest + +// 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" +) + +// NewGetIngestsObservableParams creates a new GetIngestsObservableParams 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 NewGetIngestsObservableParams() *GetIngestsObservableParams { + return &GetIngestsObservableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetIngestsObservableParamsWithTimeout creates a new GetIngestsObservableParams object +// with the ability to set a timeout on a request. +func NewGetIngestsObservableParamsWithTimeout(timeout time.Duration) *GetIngestsObservableParams { + return &GetIngestsObservableParams{ + timeout: timeout, + } +} + +// NewGetIngestsObservableParamsWithContext creates a new GetIngestsObservableParams object +// with the ability to set a context for a request. +func NewGetIngestsObservableParamsWithContext(ctx context.Context) *GetIngestsObservableParams { + return &GetIngestsObservableParams{ + Context: ctx, + } +} + +// NewGetIngestsObservableParamsWithHTTPClient creates a new GetIngestsObservableParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetIngestsObservableParamsWithHTTPClient(client *http.Client) *GetIngestsObservableParams { + return &GetIngestsObservableParams{ + HTTPClient: client, + } +} + +/* GetIngestsObservableParams contains all the parameters to send to the API endpoint + for the get ingests observable operation. + + Typically these are written to a http.Request. +*/ +type GetIngestsObservableParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get ingests observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIngestsObservableParams) WithDefaults() *GetIngestsObservableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get ingests observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIngestsObservableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get ingests observable params +func (o *GetIngestsObservableParams) WithTimeout(timeout time.Duration) *GetIngestsObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get ingests observable params +func (o *GetIngestsObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get ingests observable params +func (o *GetIngestsObservableParams) WithContext(ctx context.Context) *GetIngestsObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get ingests observable params +func (o *GetIngestsObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get ingests observable params +func (o *GetIngestsObservableParams) WithHTTPClient(client *http.Client) *GetIngestsObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get ingests observable params +func (o *GetIngestsObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetIngestsObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/ingest/get_ingests_observable_responses.go b/api/devops/devops_client/ingest/get_ingests_observable_responses.go new file mode 100644 index 0000000..f60ac13 --- /dev/null +++ b/api/devops/devops_client/ingest/get_ingests_observable_responses.go @@ -0,0 +1,337 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ingest + +// 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/telnexus/lib/api/devops/devops_models" +) + +// GetIngestsObservableReader is a Reader for the GetIngestsObservable structure. +type GetIngestsObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetIngestsObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetIngestsObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetIngestsObservableUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetIngestsObservableForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetIngestsObservableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetIngestsObservableUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetIngestsObservableInternalServerError() + 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()) + } +} + +// NewGetIngestsObservableOK creates a GetIngestsObservableOK with default headers values +func NewGetIngestsObservableOK() *GetIngestsObservableOK { + return &GetIngestsObservableOK{} +} + +/* GetIngestsObservableOK describes a response with status code 200, with default header values. + +Single Ingest record response +*/ +type GetIngestsObservableOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload []*devops_models.Ingest +} + +func (o *GetIngestsObservableOK) Error() string { + return fmt.Sprintf("[GET /ingests/observable][%d] getIngestsObservableOK %+v", 200, o.Payload) +} +func (o *GetIngestsObservableOK) GetPayload() []*devops_models.Ingest { + return o.Payload +} + +func (o *GetIngestsObservableOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetIngestsObservableUnauthorized creates a GetIngestsObservableUnauthorized with default headers values +func NewGetIngestsObservableUnauthorized() *GetIngestsObservableUnauthorized { + return &GetIngestsObservableUnauthorized{} +} + +/* GetIngestsObservableUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetIngestsObservableUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetIngestsObservableUnauthorized) Error() string { + return fmt.Sprintf("[GET /ingests/observable][%d] getIngestsObservableUnauthorized %+v", 401, o.Payload) +} +func (o *GetIngestsObservableUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetIngestsObservableUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetIngestsObservableForbidden creates a GetIngestsObservableForbidden with default headers values +func NewGetIngestsObservableForbidden() *GetIngestsObservableForbidden { + return &GetIngestsObservableForbidden{} +} + +/* GetIngestsObservableForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetIngestsObservableForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetIngestsObservableForbidden) Error() string { + return fmt.Sprintf("[GET /ingests/observable][%d] getIngestsObservableForbidden %+v", 403, o.Payload) +} +func (o *GetIngestsObservableForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetIngestsObservableForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetIngestsObservableNotFound creates a GetIngestsObservableNotFound with default headers values +func NewGetIngestsObservableNotFound() *GetIngestsObservableNotFound { + return &GetIngestsObservableNotFound{} +} + +/* GetIngestsObservableNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetIngestsObservableNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetIngestsObservableNotFound) Error() string { + return fmt.Sprintf("[GET /ingests/observable][%d] getIngestsObservableNotFound %+v", 404, o.Payload) +} +func (o *GetIngestsObservableNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetIngestsObservableNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetIngestsObservableUnprocessableEntity creates a GetIngestsObservableUnprocessableEntity with default headers values +func NewGetIngestsObservableUnprocessableEntity() *GetIngestsObservableUnprocessableEntity { + return &GetIngestsObservableUnprocessableEntity{} +} + +/* GetIngestsObservableUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetIngestsObservableUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetIngestsObservableUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /ingests/observable][%d] getIngestsObservableUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetIngestsObservableUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetIngestsObservableUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetIngestsObservableInternalServerError creates a GetIngestsObservableInternalServerError with default headers values +func NewGetIngestsObservableInternalServerError() *GetIngestsObservableInternalServerError { + return &GetIngestsObservableInternalServerError{} +} + +/* GetIngestsObservableInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetIngestsObservableInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetIngestsObservableInternalServerError) Error() string { + return fmt.Sprintf("[GET /ingests/observable][%d] getIngestsObservableInternalServerError %+v", 500, o.Payload) +} +func (o *GetIngestsObservableInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetIngestsObservableInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/ingest/get_ingests_parameters.go b/api/devops/devops_client/ingest/get_ingests_parameters.go new file mode 100644 index 0000000..580d597 --- /dev/null +++ b/api/devops/devops_client/ingest/get_ingests_parameters.go @@ -0,0 +1,306 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ingest + +// 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" +) + +// NewGetIngestsParams creates a new GetIngestsParams 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 NewGetIngestsParams() *GetIngestsParams { + return &GetIngestsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetIngestsParamsWithTimeout creates a new GetIngestsParams object +// with the ability to set a timeout on a request. +func NewGetIngestsParamsWithTimeout(timeout time.Duration) *GetIngestsParams { + return &GetIngestsParams{ + timeout: timeout, + } +} + +// NewGetIngestsParamsWithContext creates a new GetIngestsParams object +// with the ability to set a context for a request. +func NewGetIngestsParamsWithContext(ctx context.Context) *GetIngestsParams { + return &GetIngestsParams{ + Context: ctx, + } +} + +// NewGetIngestsParamsWithHTTPClient creates a new GetIngestsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetIngestsParamsWithHTTPClient(client *http.Client) *GetIngestsParams { + return &GetIngestsParams{ + HTTPClient: client, + } +} + +/* GetIngestsParams contains all the parameters to send to the API endpoint + for the get ingests operation. + + Typically these are written to a http.Request. +*/ +type GetIngestsParams struct { + + /* AccountID. + + Telnexus Record Id of an Account + */ + AccountID *string + + /* CompanyID. + + Telnexus Record Id of a Company + */ + CompanyID *string + + /* IngestID. + + Telnexus Record Id of an Ingest + */ + IngestID *string + + /* Limit. + + How many objects to return at one time + + Format: int64 + */ + Limit *int64 + + /* Offset. + + How many objects to skip? (default 0) + + Format: int64 + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get ingests params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIngestsParams) WithDefaults() *GetIngestsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get ingests params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIngestsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get ingests params +func (o *GetIngestsParams) WithTimeout(timeout time.Duration) *GetIngestsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get ingests params +func (o *GetIngestsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get ingests params +func (o *GetIngestsParams) WithContext(ctx context.Context) *GetIngestsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get ingests params +func (o *GetIngestsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get ingests params +func (o *GetIngestsParams) WithHTTPClient(client *http.Client) *GetIngestsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get ingests params +func (o *GetIngestsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get ingests params +func (o *GetIngestsParams) WithAccountID(accountID *string) *GetIngestsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get ingests params +func (o *GetIngestsParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithCompanyID adds the companyID to the get ingests params +func (o *GetIngestsParams) WithCompanyID(companyID *string) *GetIngestsParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get ingests params +func (o *GetIngestsParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WithIngestID adds the ingestID to the get ingests params +func (o *GetIngestsParams) WithIngestID(ingestID *string) *GetIngestsParams { + o.SetIngestID(ingestID) + return o +} + +// SetIngestID adds the ingestId to the get ingests params +func (o *GetIngestsParams) SetIngestID(ingestID *string) { + o.IngestID = ingestID +} + +// WithLimit adds the limit to the get ingests params +func (o *GetIngestsParams) WithLimit(limit *int64) *GetIngestsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get ingests params +func (o *GetIngestsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get ingests params +func (o *GetIngestsParams) WithOffset(offset *int64) *GetIngestsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get ingests params +func (o *GetIngestsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetIngestsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AccountID != nil { + + // query param accountId + var qrAccountID string + + if o.AccountID != nil { + qrAccountID = *o.AccountID + } + qAccountID := qrAccountID + if qAccountID != "" { + + if err := r.SetQueryParam("accountId", qAccountID); err != nil { + return err + } + } + } + + if o.CompanyID != nil { + + // query param companyId + var qrCompanyID string + + if o.CompanyID != nil { + qrCompanyID = *o.CompanyID + } + qCompanyID := qrCompanyID + if qCompanyID != "" { + + if err := r.SetQueryParam("companyId", qCompanyID); err != nil { + return err + } + } + } + + if o.IngestID != nil { + + // query param ingestId + var qrIngestID string + + if o.IngestID != nil { + qrIngestID = *o.IngestID + } + qIngestID := qrIngestID + if qIngestID != "" { + + if err := r.SetQueryParam("ingestId", qIngestID); 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 +} diff --git a/api/devops/devops_client/ingest/get_ingests_responses.go b/api/devops/devops_client/ingest/get_ingests_responses.go new file mode 100644 index 0000000..36ac501 --- /dev/null +++ b/api/devops/devops_client/ingest/get_ingests_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ingest + +// 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/telnexus/lib/api/devops/devops_models" +) + +// GetIngestsReader is a Reader for the GetIngests structure. +type GetIngestsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetIngestsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetIngestsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetIngestsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetIngestsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetIngestsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetIngestsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetIngestsInternalServerError() + 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()) + } +} + +// NewGetIngestsOK creates a GetIngestsOK with default headers values +func NewGetIngestsOK() *GetIngestsOK { + return &GetIngestsOK{} +} + +/* GetIngestsOK describes a response with status code 200, with default header values. + +Telnexus Response with Ingest objects +*/ +type GetIngestsOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.IngestResponse +} + +func (o *GetIngestsOK) Error() string { + return fmt.Sprintf("[GET /ingests][%d] getIngestsOK %+v", 200, o.Payload) +} +func (o *GetIngestsOK) GetPayload() *devops_models.IngestResponse { + return o.Payload +} + +func (o *GetIngestsOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.IngestResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetIngestsUnauthorized creates a GetIngestsUnauthorized with default headers values +func NewGetIngestsUnauthorized() *GetIngestsUnauthorized { + return &GetIngestsUnauthorized{} +} + +/* GetIngestsUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetIngestsUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetIngestsUnauthorized) Error() string { + return fmt.Sprintf("[GET /ingests][%d] getIngestsUnauthorized %+v", 401, o.Payload) +} +func (o *GetIngestsUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetIngestsUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetIngestsForbidden creates a GetIngestsForbidden with default headers values +func NewGetIngestsForbidden() *GetIngestsForbidden { + return &GetIngestsForbidden{} +} + +/* GetIngestsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetIngestsForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetIngestsForbidden) Error() string { + return fmt.Sprintf("[GET /ingests][%d] getIngestsForbidden %+v", 403, o.Payload) +} +func (o *GetIngestsForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetIngestsForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetIngestsNotFound creates a GetIngestsNotFound with default headers values +func NewGetIngestsNotFound() *GetIngestsNotFound { + return &GetIngestsNotFound{} +} + +/* GetIngestsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetIngestsNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetIngestsNotFound) Error() string { + return fmt.Sprintf("[GET /ingests][%d] getIngestsNotFound %+v", 404, o.Payload) +} +func (o *GetIngestsNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetIngestsNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetIngestsUnprocessableEntity creates a GetIngestsUnprocessableEntity with default headers values +func NewGetIngestsUnprocessableEntity() *GetIngestsUnprocessableEntity { + return &GetIngestsUnprocessableEntity{} +} + +/* GetIngestsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetIngestsUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetIngestsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /ingests][%d] getIngestsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetIngestsUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetIngestsUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetIngestsInternalServerError creates a GetIngestsInternalServerError with default headers values +func NewGetIngestsInternalServerError() *GetIngestsInternalServerError { + return &GetIngestsInternalServerError{} +} + +/* GetIngestsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetIngestsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetIngestsInternalServerError) Error() string { + return fmt.Sprintf("[GET /ingests][%d] getIngestsInternalServerError %+v", 500, o.Payload) +} +func (o *GetIngestsInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetIngestsInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/ingest/ingest_client.go b/api/devops/devops_client/ingest/ingest_client.go new file mode 100644 index 0000000..dd144f3 --- /dev/null +++ b/api/devops/devops_client/ingest/ingest_client.go @@ -0,0 +1,258 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ingest + +// 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 ingest API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for ingest 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 { + GetIngest(params *GetIngestParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIngestOK, error) + + GetIngests(params *GetIngestsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIngestsOK, error) + + GetIngestsObservable(params *GetIngestsObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIngestsObservableOK, error) + + PostIngests(params *PostIngestsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostIngestsOK, error) + + PutIngests(params *PutIngestsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutIngestsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetIngest gets a single ingest object + + Return a single Ingest object from datastore as a Singleton +*/ +func (a *Client) GetIngest(params *GetIngestParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIngestOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetIngestParams() + } + op := &runtime.ClientOperation{ + ID: "getIngest", + Method: "GET", + PathPattern: "/ingests/{ingestIdPath}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetIngestReader{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.(*GetIngestOK) + 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 getIngest: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetIngests gets a list ingests + + Return a list of Ingest records +*/ +func (a *Client) GetIngests(params *GetIngestsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIngestsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetIngestsParams() + } + op := &runtime.ClientOperation{ + ID: "getIngests", + Method: "GET", + PathPattern: "/ingests", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetIngestsReader{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.(*GetIngestsOK) + 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 getIngests: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetIngestsObservable gets ingests in an observable array + + Returns a Ingest retrieval in a observable array +*/ +func (a *Client) GetIngestsObservable(params *GetIngestsObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIngestsObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetIngestsObservableParams() + } + op := &runtime.ClientOperation{ + ID: "getIngestsObservable", + Method: "GET", + PathPattern: "/ingests/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetIngestsObservableReader{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.(*GetIngestsObservableOK) + 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 getIngestsObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostIngests creates new ingests + + Create new Ingests +*/ +func (a *Client) PostIngests(params *PostIngestsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostIngestsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostIngestsParams() + } + op := &runtime.ClientOperation{ + ID: "postIngests", + Method: "POST", + PathPattern: "/ingests", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostIngestsReader{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.(*PostIngestsOK) + 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 postIngests: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutIngests updates ingests + + Update Ingests +*/ +func (a *Client) PutIngests(params *PutIngestsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutIngestsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutIngestsParams() + } + op := &runtime.ClientOperation{ + ID: "putIngests", + Method: "PUT", + PathPattern: "/ingests", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutIngestsReader{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.(*PutIngestsOK) + 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 putIngests: 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 +} diff --git a/api/devops/devops_client/ingest/post_ingests_parameters.go b/api/devops/devops_client/ingest/post_ingests_parameters.go new file mode 100644 index 0000000..d5f86b6 --- /dev/null +++ b/api/devops/devops_client/ingest/post_ingests_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ingest + +// 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/telnexus/lib/api/devops/devops_models" +) + +// NewPostIngestsParams creates a new PostIngestsParams 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 NewPostIngestsParams() *PostIngestsParams { + return &PostIngestsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostIngestsParamsWithTimeout creates a new PostIngestsParams object +// with the ability to set a timeout on a request. +func NewPostIngestsParamsWithTimeout(timeout time.Duration) *PostIngestsParams { + return &PostIngestsParams{ + timeout: timeout, + } +} + +// NewPostIngestsParamsWithContext creates a new PostIngestsParams object +// with the ability to set a context for a request. +func NewPostIngestsParamsWithContext(ctx context.Context) *PostIngestsParams { + return &PostIngestsParams{ + Context: ctx, + } +} + +// NewPostIngestsParamsWithHTTPClient creates a new PostIngestsParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostIngestsParamsWithHTTPClient(client *http.Client) *PostIngestsParams { + return &PostIngestsParams{ + HTTPClient: client, + } +} + +/* PostIngestsParams contains all the parameters to send to the API endpoint + for the post ingests operation. + + Typically these are written to a http.Request. +*/ +type PostIngestsParams struct { + + /* IngestRequest. + + An array of Ingest records + */ + IngestRequest *devops_models.IngestRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post ingests params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostIngestsParams) WithDefaults() *PostIngestsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post ingests params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostIngestsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post ingests params +func (o *PostIngestsParams) WithTimeout(timeout time.Duration) *PostIngestsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post ingests params +func (o *PostIngestsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post ingests params +func (o *PostIngestsParams) WithContext(ctx context.Context) *PostIngestsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post ingests params +func (o *PostIngestsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post ingests params +func (o *PostIngestsParams) WithHTTPClient(client *http.Client) *PostIngestsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post ingests params +func (o *PostIngestsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIngestRequest adds the ingestRequest to the post ingests params +func (o *PostIngestsParams) WithIngestRequest(ingestRequest *devops_models.IngestRequest) *PostIngestsParams { + o.SetIngestRequest(ingestRequest) + return o +} + +// SetIngestRequest adds the ingestRequest to the post ingests params +func (o *PostIngestsParams) SetIngestRequest(ingestRequest *devops_models.IngestRequest) { + o.IngestRequest = ingestRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostIngestsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.IngestRequest != nil { + if err := r.SetBodyParam(o.IngestRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/ingest/post_ingests_responses.go b/api/devops/devops_client/ingest/post_ingests_responses.go new file mode 100644 index 0000000..fde931f --- /dev/null +++ b/api/devops/devops_client/ingest/post_ingests_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ingest + +// 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/telnexus/lib/api/devops/devops_models" +) + +// PostIngestsReader is a Reader for the PostIngests structure. +type PostIngestsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostIngestsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostIngestsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostIngestsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostIngestsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostIngestsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostIngestsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostIngestsInternalServerError() + 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()) + } +} + +// NewPostIngestsOK creates a PostIngestsOK with default headers values +func NewPostIngestsOK() *PostIngestsOK { + return &PostIngestsOK{} +} + +/* PostIngestsOK describes a response with status code 200, with default header values. + +Telnexus Response with Ingest objects +*/ +type PostIngestsOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.IngestResponse +} + +func (o *PostIngestsOK) Error() string { + return fmt.Sprintf("[POST /ingests][%d] postIngestsOK %+v", 200, o.Payload) +} +func (o *PostIngestsOK) GetPayload() *devops_models.IngestResponse { + return o.Payload +} + +func (o *PostIngestsOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.IngestResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostIngestsUnauthorized creates a PostIngestsUnauthorized with default headers values +func NewPostIngestsUnauthorized() *PostIngestsUnauthorized { + return &PostIngestsUnauthorized{} +} + +/* PostIngestsUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostIngestsUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PostIngestsUnauthorized) Error() string { + return fmt.Sprintf("[POST /ingests][%d] postIngestsUnauthorized %+v", 401, o.Payload) +} +func (o *PostIngestsUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostIngestsUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostIngestsForbidden creates a PostIngestsForbidden with default headers values +func NewPostIngestsForbidden() *PostIngestsForbidden { + return &PostIngestsForbidden{} +} + +/* PostIngestsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostIngestsForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostIngestsForbidden) Error() string { + return fmt.Sprintf("[POST /ingests][%d] postIngestsForbidden %+v", 403, o.Payload) +} +func (o *PostIngestsForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostIngestsForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostIngestsNotFound creates a PostIngestsNotFound with default headers values +func NewPostIngestsNotFound() *PostIngestsNotFound { + return &PostIngestsNotFound{} +} + +/* PostIngestsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostIngestsNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostIngestsNotFound) Error() string { + return fmt.Sprintf("[POST /ingests][%d] postIngestsNotFound %+v", 404, o.Payload) +} +func (o *PostIngestsNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostIngestsNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostIngestsUnprocessableEntity creates a PostIngestsUnprocessableEntity with default headers values +func NewPostIngestsUnprocessableEntity() *PostIngestsUnprocessableEntity { + return &PostIngestsUnprocessableEntity{} +} + +/* PostIngestsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostIngestsUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PostIngestsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /ingests][%d] postIngestsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PostIngestsUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostIngestsUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostIngestsInternalServerError creates a PostIngestsInternalServerError with default headers values +func NewPostIngestsInternalServerError() *PostIngestsInternalServerError { + return &PostIngestsInternalServerError{} +} + +/* PostIngestsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostIngestsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostIngestsInternalServerError) Error() string { + return fmt.Sprintf("[POST /ingests][%d] postIngestsInternalServerError %+v", 500, o.Payload) +} +func (o *PostIngestsInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostIngestsInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/ingest/put_ingests_parameters.go b/api/devops/devops_client/ingest/put_ingests_parameters.go new file mode 100644 index 0000000..437ac40 --- /dev/null +++ b/api/devops/devops_client/ingest/put_ingests_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ingest + +// 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/telnexus/lib/api/devops/devops_models" +) + +// NewPutIngestsParams creates a new PutIngestsParams 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 NewPutIngestsParams() *PutIngestsParams { + return &PutIngestsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPutIngestsParamsWithTimeout creates a new PutIngestsParams object +// with the ability to set a timeout on a request. +func NewPutIngestsParamsWithTimeout(timeout time.Duration) *PutIngestsParams { + return &PutIngestsParams{ + timeout: timeout, + } +} + +// NewPutIngestsParamsWithContext creates a new PutIngestsParams object +// with the ability to set a context for a request. +func NewPutIngestsParamsWithContext(ctx context.Context) *PutIngestsParams { + return &PutIngestsParams{ + Context: ctx, + } +} + +// NewPutIngestsParamsWithHTTPClient creates a new PutIngestsParams object +// with the ability to set a custom HTTPClient for a request. +func NewPutIngestsParamsWithHTTPClient(client *http.Client) *PutIngestsParams { + return &PutIngestsParams{ + HTTPClient: client, + } +} + +/* PutIngestsParams contains all the parameters to send to the API endpoint + for the put ingests operation. + + Typically these are written to a http.Request. +*/ +type PutIngestsParams struct { + + /* IngestRequest. + + An array of Ingest records + */ + IngestRequest *devops_models.IngestRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put ingests params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutIngestsParams) WithDefaults() *PutIngestsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put ingests params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutIngestsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the put ingests params +func (o *PutIngestsParams) WithTimeout(timeout time.Duration) *PutIngestsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put ingests params +func (o *PutIngestsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put ingests params +func (o *PutIngestsParams) WithContext(ctx context.Context) *PutIngestsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put ingests params +func (o *PutIngestsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put ingests params +func (o *PutIngestsParams) WithHTTPClient(client *http.Client) *PutIngestsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put ingests params +func (o *PutIngestsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIngestRequest adds the ingestRequest to the put ingests params +func (o *PutIngestsParams) WithIngestRequest(ingestRequest *devops_models.IngestRequest) *PutIngestsParams { + o.SetIngestRequest(ingestRequest) + return o +} + +// SetIngestRequest adds the ingestRequest to the put ingests params +func (o *PutIngestsParams) SetIngestRequest(ingestRequest *devops_models.IngestRequest) { + o.IngestRequest = ingestRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutIngestsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.IngestRequest != nil { + if err := r.SetBodyParam(o.IngestRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/ingest/put_ingests_responses.go b/api/devops/devops_client/ingest/put_ingests_responses.go new file mode 100644 index 0000000..1bbd3ed --- /dev/null +++ b/api/devops/devops_client/ingest/put_ingests_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ingest + +// 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/telnexus/lib/api/devops/devops_models" +) + +// PutIngestsReader is a Reader for the PutIngests structure. +type PutIngestsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutIngestsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutIngestsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutIngestsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutIngestsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutIngestsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutIngestsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutIngestsInternalServerError() + 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()) + } +} + +// NewPutIngestsOK creates a PutIngestsOK with default headers values +func NewPutIngestsOK() *PutIngestsOK { + return &PutIngestsOK{} +} + +/* PutIngestsOK describes a response with status code 200, with default header values. + +Telnexus Response with Ingest objects +*/ +type PutIngestsOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.IngestResponse +} + +func (o *PutIngestsOK) Error() string { + return fmt.Sprintf("[PUT /ingests][%d] putIngestsOK %+v", 200, o.Payload) +} +func (o *PutIngestsOK) GetPayload() *devops_models.IngestResponse { + return o.Payload +} + +func (o *PutIngestsOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.IngestResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutIngestsUnauthorized creates a PutIngestsUnauthorized with default headers values +func NewPutIngestsUnauthorized() *PutIngestsUnauthorized { + return &PutIngestsUnauthorized{} +} + +/* PutIngestsUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutIngestsUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PutIngestsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /ingests][%d] putIngestsUnauthorized %+v", 401, o.Payload) +} +func (o *PutIngestsUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutIngestsUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutIngestsForbidden creates a PutIngestsForbidden with default headers values +func NewPutIngestsForbidden() *PutIngestsForbidden { + return &PutIngestsForbidden{} +} + +/* PutIngestsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PutIngestsForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PutIngestsForbidden) Error() string { + return fmt.Sprintf("[PUT /ingests][%d] putIngestsForbidden %+v", 403, o.Payload) +} +func (o *PutIngestsForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutIngestsForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutIngestsNotFound creates a PutIngestsNotFound with default headers values +func NewPutIngestsNotFound() *PutIngestsNotFound { + return &PutIngestsNotFound{} +} + +/* PutIngestsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PutIngestsNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PutIngestsNotFound) Error() string { + return fmt.Sprintf("[PUT /ingests][%d] putIngestsNotFound %+v", 404, o.Payload) +} +func (o *PutIngestsNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutIngestsNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutIngestsUnprocessableEntity creates a PutIngestsUnprocessableEntity with default headers values +func NewPutIngestsUnprocessableEntity() *PutIngestsUnprocessableEntity { + return &PutIngestsUnprocessableEntity{} +} + +/* PutIngestsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutIngestsUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PutIngestsUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /ingests][%d] putIngestsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PutIngestsUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutIngestsUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutIngestsInternalServerError creates a PutIngestsInternalServerError with default headers values +func NewPutIngestsInternalServerError() *PutIngestsInternalServerError { + return &PutIngestsInternalServerError{} +} + +/* PutIngestsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PutIngestsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PutIngestsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /ingests][%d] putIngestsInternalServerError %+v", 500, o.Payload) +} +func (o *PutIngestsInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutIngestsInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/job/get_job_parameters.go b/api/devops/devops_client/job/get_job_parameters.go new file mode 100644 index 0000000..59f86a2 --- /dev/null +++ b/api/devops/devops_client/job/get_job_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package job + +// 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" +) + +// NewGetJobParams creates a new GetJobParams 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 NewGetJobParams() *GetJobParams { + return &GetJobParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetJobParamsWithTimeout creates a new GetJobParams object +// with the ability to set a timeout on a request. +func NewGetJobParamsWithTimeout(timeout time.Duration) *GetJobParams { + return &GetJobParams{ + timeout: timeout, + } +} + +// NewGetJobParamsWithContext creates a new GetJobParams object +// with the ability to set a context for a request. +func NewGetJobParamsWithContext(ctx context.Context) *GetJobParams { + return &GetJobParams{ + Context: ctx, + } +} + +// NewGetJobParamsWithHTTPClient creates a new GetJobParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetJobParamsWithHTTPClient(client *http.Client) *GetJobParams { + return &GetJobParams{ + HTTPClient: client, + } +} + +/* GetJobParams contains all the parameters to send to the API endpoint + for the get job operation. + + Typically these are written to a http.Request. +*/ +type GetJobParams struct { + + /* JobIDPath. + + Telnexus Record Id of a Job + */ + JobIDPath string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get job params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetJobParams) WithDefaults() *GetJobParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get job params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetJobParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get job params +func (o *GetJobParams) WithTimeout(timeout time.Duration) *GetJobParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get job params +func (o *GetJobParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get job params +func (o *GetJobParams) WithContext(ctx context.Context) *GetJobParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get job params +func (o *GetJobParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get job params +func (o *GetJobParams) WithHTTPClient(client *http.Client) *GetJobParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get job params +func (o *GetJobParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithJobIDPath adds the jobIDPath to the get job params +func (o *GetJobParams) WithJobIDPath(jobIDPath string) *GetJobParams { + o.SetJobIDPath(jobIDPath) + return o +} + +// SetJobIDPath adds the jobIdPath to the get job params +func (o *GetJobParams) SetJobIDPath(jobIDPath string) { + o.JobIDPath = jobIDPath +} + +// WriteToRequest writes these params to a swagger request +func (o *GetJobParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param jobIdPath + if err := r.SetPathParam("jobIdPath", o.JobIDPath); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/job/get_job_responses.go b/api/devops/devops_client/job/get_job_responses.go new file mode 100644 index 0000000..ef78930 --- /dev/null +++ b/api/devops/devops_client/job/get_job_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package job + +// 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/telnexus/lib/api/devops/devops_models" +) + +// GetJobReader is a Reader for the GetJob structure. +type GetJobReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetJobReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetJobOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetJobUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetJobForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetJobNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetJobUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetJobInternalServerError() + 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()) + } +} + +// NewGetJobOK creates a GetJobOK with default headers values +func NewGetJobOK() *GetJobOK { + return &GetJobOK{} +} + +/* GetJobOK describes a response with status code 200, with default header values. + +Single Job record response +*/ +type GetJobOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Job +} + +func (o *GetJobOK) Error() string { + return fmt.Sprintf("[GET /jobs/{jobIdPath}][%d] getJobOK %+v", 200, o.Payload) +} +func (o *GetJobOK) GetPayload() *devops_models.Job { + return o.Payload +} + +func (o *GetJobOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Job) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJobUnauthorized creates a GetJobUnauthorized with default headers values +func NewGetJobUnauthorized() *GetJobUnauthorized { + return &GetJobUnauthorized{} +} + +/* GetJobUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetJobUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetJobUnauthorized) Error() string { + return fmt.Sprintf("[GET /jobs/{jobIdPath}][%d] getJobUnauthorized %+v", 401, o.Payload) +} +func (o *GetJobUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetJobUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJobForbidden creates a GetJobForbidden with default headers values +func NewGetJobForbidden() *GetJobForbidden { + return &GetJobForbidden{} +} + +/* GetJobForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetJobForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetJobForbidden) Error() string { + return fmt.Sprintf("[GET /jobs/{jobIdPath}][%d] getJobForbidden %+v", 403, o.Payload) +} +func (o *GetJobForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetJobForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJobNotFound creates a GetJobNotFound with default headers values +func NewGetJobNotFound() *GetJobNotFound { + return &GetJobNotFound{} +} + +/* GetJobNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetJobNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetJobNotFound) Error() string { + return fmt.Sprintf("[GET /jobs/{jobIdPath}][%d] getJobNotFound %+v", 404, o.Payload) +} +func (o *GetJobNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetJobNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJobUnprocessableEntity creates a GetJobUnprocessableEntity with default headers values +func NewGetJobUnprocessableEntity() *GetJobUnprocessableEntity { + return &GetJobUnprocessableEntity{} +} + +/* GetJobUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetJobUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetJobUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /jobs/{jobIdPath}][%d] getJobUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetJobUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetJobUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJobInternalServerError creates a GetJobInternalServerError with default headers values +func NewGetJobInternalServerError() *GetJobInternalServerError { + return &GetJobInternalServerError{} +} + +/* GetJobInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetJobInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetJobInternalServerError) Error() string { + return fmt.Sprintf("[GET /jobs/{jobIdPath}][%d] getJobInternalServerError %+v", 500, o.Payload) +} +func (o *GetJobInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetJobInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/job/get_jobs_observable_parameters.go b/api/devops/devops_client/job/get_jobs_observable_parameters.go new file mode 100644 index 0000000..15f2f34 --- /dev/null +++ b/api/devops/devops_client/job/get_jobs_observable_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package job + +// 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" +) + +// NewGetJobsObservableParams creates a new GetJobsObservableParams 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 NewGetJobsObservableParams() *GetJobsObservableParams { + return &GetJobsObservableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetJobsObservableParamsWithTimeout creates a new GetJobsObservableParams object +// with the ability to set a timeout on a request. +func NewGetJobsObservableParamsWithTimeout(timeout time.Duration) *GetJobsObservableParams { + return &GetJobsObservableParams{ + timeout: timeout, + } +} + +// NewGetJobsObservableParamsWithContext creates a new GetJobsObservableParams object +// with the ability to set a context for a request. +func NewGetJobsObservableParamsWithContext(ctx context.Context) *GetJobsObservableParams { + return &GetJobsObservableParams{ + Context: ctx, + } +} + +// NewGetJobsObservableParamsWithHTTPClient creates a new GetJobsObservableParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetJobsObservableParamsWithHTTPClient(client *http.Client) *GetJobsObservableParams { + return &GetJobsObservableParams{ + HTTPClient: client, + } +} + +/* GetJobsObservableParams contains all the parameters to send to the API endpoint + for the get jobs observable operation. + + Typically these are written to a http.Request. +*/ +type GetJobsObservableParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get jobs observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetJobsObservableParams) WithDefaults() *GetJobsObservableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get jobs observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetJobsObservableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get jobs observable params +func (o *GetJobsObservableParams) WithTimeout(timeout time.Duration) *GetJobsObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get jobs observable params +func (o *GetJobsObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get jobs observable params +func (o *GetJobsObservableParams) WithContext(ctx context.Context) *GetJobsObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get jobs observable params +func (o *GetJobsObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get jobs observable params +func (o *GetJobsObservableParams) WithHTTPClient(client *http.Client) *GetJobsObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get jobs observable params +func (o *GetJobsObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetJobsObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/job/get_jobs_observable_responses.go b/api/devops/devops_client/job/get_jobs_observable_responses.go new file mode 100644 index 0000000..f791426 --- /dev/null +++ b/api/devops/devops_client/job/get_jobs_observable_responses.go @@ -0,0 +1,337 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package job + +// 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/telnexus/lib/api/devops/devops_models" +) + +// GetJobsObservableReader is a Reader for the GetJobsObservable structure. +type GetJobsObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetJobsObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetJobsObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetJobsObservableUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetJobsObservableForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetJobsObservableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetJobsObservableUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetJobsObservableInternalServerError() + 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()) + } +} + +// NewGetJobsObservableOK creates a GetJobsObservableOK with default headers values +func NewGetJobsObservableOK() *GetJobsObservableOK { + return &GetJobsObservableOK{} +} + +/* GetJobsObservableOK describes a response with status code 200, with default header values. + +Single Job record response +*/ +type GetJobsObservableOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload []*devops_models.Job +} + +func (o *GetJobsObservableOK) Error() string { + return fmt.Sprintf("[GET /jobs/observable][%d] getJobsObservableOK %+v", 200, o.Payload) +} +func (o *GetJobsObservableOK) GetPayload() []*devops_models.Job { + return o.Payload +} + +func (o *GetJobsObservableOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJobsObservableUnauthorized creates a GetJobsObservableUnauthorized with default headers values +func NewGetJobsObservableUnauthorized() *GetJobsObservableUnauthorized { + return &GetJobsObservableUnauthorized{} +} + +/* GetJobsObservableUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetJobsObservableUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetJobsObservableUnauthorized) Error() string { + return fmt.Sprintf("[GET /jobs/observable][%d] getJobsObservableUnauthorized %+v", 401, o.Payload) +} +func (o *GetJobsObservableUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetJobsObservableUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJobsObservableForbidden creates a GetJobsObservableForbidden with default headers values +func NewGetJobsObservableForbidden() *GetJobsObservableForbidden { + return &GetJobsObservableForbidden{} +} + +/* GetJobsObservableForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetJobsObservableForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetJobsObservableForbidden) Error() string { + return fmt.Sprintf("[GET /jobs/observable][%d] getJobsObservableForbidden %+v", 403, o.Payload) +} +func (o *GetJobsObservableForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetJobsObservableForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJobsObservableNotFound creates a GetJobsObservableNotFound with default headers values +func NewGetJobsObservableNotFound() *GetJobsObservableNotFound { + return &GetJobsObservableNotFound{} +} + +/* GetJobsObservableNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetJobsObservableNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetJobsObservableNotFound) Error() string { + return fmt.Sprintf("[GET /jobs/observable][%d] getJobsObservableNotFound %+v", 404, o.Payload) +} +func (o *GetJobsObservableNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetJobsObservableNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJobsObservableUnprocessableEntity creates a GetJobsObservableUnprocessableEntity with default headers values +func NewGetJobsObservableUnprocessableEntity() *GetJobsObservableUnprocessableEntity { + return &GetJobsObservableUnprocessableEntity{} +} + +/* GetJobsObservableUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetJobsObservableUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetJobsObservableUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /jobs/observable][%d] getJobsObservableUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetJobsObservableUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetJobsObservableUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJobsObservableInternalServerError creates a GetJobsObservableInternalServerError with default headers values +func NewGetJobsObservableInternalServerError() *GetJobsObservableInternalServerError { + return &GetJobsObservableInternalServerError{} +} + +/* GetJobsObservableInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetJobsObservableInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetJobsObservableInternalServerError) Error() string { + return fmt.Sprintf("[GET /jobs/observable][%d] getJobsObservableInternalServerError %+v", 500, o.Payload) +} +func (o *GetJobsObservableInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetJobsObservableInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/job/get_jobs_parameters.go b/api/devops/devops_client/job/get_jobs_parameters.go new file mode 100644 index 0000000..13517c2 --- /dev/null +++ b/api/devops/devops_client/job/get_jobs_parameters.go @@ -0,0 +1,340 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package job + +// 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" +) + +// NewGetJobsParams creates a new GetJobsParams 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 NewGetJobsParams() *GetJobsParams { + return &GetJobsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetJobsParamsWithTimeout creates a new GetJobsParams object +// with the ability to set a timeout on a request. +func NewGetJobsParamsWithTimeout(timeout time.Duration) *GetJobsParams { + return &GetJobsParams{ + timeout: timeout, + } +} + +// NewGetJobsParamsWithContext creates a new GetJobsParams object +// with the ability to set a context for a request. +func NewGetJobsParamsWithContext(ctx context.Context) *GetJobsParams { + return &GetJobsParams{ + Context: ctx, + } +} + +// NewGetJobsParamsWithHTTPClient creates a new GetJobsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetJobsParamsWithHTTPClient(client *http.Client) *GetJobsParams { + return &GetJobsParams{ + HTTPClient: client, + } +} + +/* GetJobsParams contains all the parameters to send to the API endpoint + for the get jobs operation. + + Typically these are written to a http.Request. +*/ +type GetJobsParams struct { + + /* AccountID. + + Telnexus Record Id of an Account + */ + AccountID *string + + /* Active. + + Retrieve active records only? + */ + Active *bool + + /* CompanyID. + + Telnexus Record Id of a Company + */ + CompanyID *string + + /* JobID. + + Telnexus Record Id of a Job + */ + JobID *string + + /* Limit. + + How many objects to return at one time + + Format: int64 + */ + Limit *int64 + + /* Offset. + + How many objects to skip? (default 0) + + Format: int64 + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get jobs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetJobsParams) WithDefaults() *GetJobsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get jobs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetJobsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get jobs params +func (o *GetJobsParams) WithTimeout(timeout time.Duration) *GetJobsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get jobs params +func (o *GetJobsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get jobs params +func (o *GetJobsParams) WithContext(ctx context.Context) *GetJobsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get jobs params +func (o *GetJobsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get jobs params +func (o *GetJobsParams) WithHTTPClient(client *http.Client) *GetJobsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get jobs params +func (o *GetJobsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get jobs params +func (o *GetJobsParams) WithAccountID(accountID *string) *GetJobsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get jobs params +func (o *GetJobsParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithActive adds the active to the get jobs params +func (o *GetJobsParams) WithActive(active *bool) *GetJobsParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get jobs params +func (o *GetJobsParams) SetActive(active *bool) { + o.Active = active +} + +// WithCompanyID adds the companyID to the get jobs params +func (o *GetJobsParams) WithCompanyID(companyID *string) *GetJobsParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get jobs params +func (o *GetJobsParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WithJobID adds the jobID to the get jobs params +func (o *GetJobsParams) WithJobID(jobID *string) *GetJobsParams { + o.SetJobID(jobID) + return o +} + +// SetJobID adds the jobId to the get jobs params +func (o *GetJobsParams) SetJobID(jobID *string) { + o.JobID = jobID +} + +// WithLimit adds the limit to the get jobs params +func (o *GetJobsParams) WithLimit(limit *int64) *GetJobsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get jobs params +func (o *GetJobsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get jobs params +func (o *GetJobsParams) WithOffset(offset *int64) *GetJobsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get jobs params +func (o *GetJobsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetJobsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AccountID != nil { + + // query param accountId + var qrAccountID string + + if o.AccountID != nil { + qrAccountID = *o.AccountID + } + qAccountID := qrAccountID + if qAccountID != "" { + + if err := r.SetQueryParam("accountId", qAccountID); err != nil { + return err + } + } + } + + if o.Active != nil { + + // query param active + var qrActive bool + + if o.Active != nil { + qrActive = *o.Active + } + qActive := swag.FormatBool(qrActive) + if qActive != "" { + + if err := r.SetQueryParam("active", qActive); err != nil { + return err + } + } + } + + if o.CompanyID != nil { + + // query param companyId + var qrCompanyID string + + if o.CompanyID != nil { + qrCompanyID = *o.CompanyID + } + qCompanyID := qrCompanyID + if qCompanyID != "" { + + if err := r.SetQueryParam("companyId", qCompanyID); err != nil { + return err + } + } + } + + if o.JobID != nil { + + // query param jobId + var qrJobID string + + if o.JobID != nil { + qrJobID = *o.JobID + } + qJobID := qrJobID + if qJobID != "" { + + if err := r.SetQueryParam("jobId", qJobID); 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 +} diff --git a/api/devops/devops_client/job/get_jobs_responses.go b/api/devops/devops_client/job/get_jobs_responses.go new file mode 100644 index 0000000..74ab2ec --- /dev/null +++ b/api/devops/devops_client/job/get_jobs_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package job + +// 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/telnexus/lib/api/devops/devops_models" +) + +// GetJobsReader is a Reader for the GetJobs structure. +type GetJobsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetJobsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetJobsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetJobsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetJobsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetJobsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetJobsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetJobsInternalServerError() + 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()) + } +} + +// NewGetJobsOK creates a GetJobsOK with default headers values +func NewGetJobsOK() *GetJobsOK { + return &GetJobsOK{} +} + +/* GetJobsOK describes a response with status code 200, with default header values. + +Telnexus Response with Job objects +*/ +type GetJobsOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.JobResponse +} + +func (o *GetJobsOK) Error() string { + return fmt.Sprintf("[GET /jobs][%d] getJobsOK %+v", 200, o.Payload) +} +func (o *GetJobsOK) GetPayload() *devops_models.JobResponse { + return o.Payload +} + +func (o *GetJobsOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.JobResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJobsUnauthorized creates a GetJobsUnauthorized with default headers values +func NewGetJobsUnauthorized() *GetJobsUnauthorized { + return &GetJobsUnauthorized{} +} + +/* GetJobsUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetJobsUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetJobsUnauthorized) Error() string { + return fmt.Sprintf("[GET /jobs][%d] getJobsUnauthorized %+v", 401, o.Payload) +} +func (o *GetJobsUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetJobsUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJobsForbidden creates a GetJobsForbidden with default headers values +func NewGetJobsForbidden() *GetJobsForbidden { + return &GetJobsForbidden{} +} + +/* GetJobsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetJobsForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetJobsForbidden) Error() string { + return fmt.Sprintf("[GET /jobs][%d] getJobsForbidden %+v", 403, o.Payload) +} +func (o *GetJobsForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetJobsForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJobsNotFound creates a GetJobsNotFound with default headers values +func NewGetJobsNotFound() *GetJobsNotFound { + return &GetJobsNotFound{} +} + +/* GetJobsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetJobsNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetJobsNotFound) Error() string { + return fmt.Sprintf("[GET /jobs][%d] getJobsNotFound %+v", 404, o.Payload) +} +func (o *GetJobsNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetJobsNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJobsUnprocessableEntity creates a GetJobsUnprocessableEntity with default headers values +func NewGetJobsUnprocessableEntity() *GetJobsUnprocessableEntity { + return &GetJobsUnprocessableEntity{} +} + +/* GetJobsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetJobsUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetJobsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /jobs][%d] getJobsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetJobsUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetJobsUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJobsInternalServerError creates a GetJobsInternalServerError with default headers values +func NewGetJobsInternalServerError() *GetJobsInternalServerError { + return &GetJobsInternalServerError{} +} + +/* GetJobsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetJobsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetJobsInternalServerError) Error() string { + return fmt.Sprintf("[GET /jobs][%d] getJobsInternalServerError %+v", 500, o.Payload) +} +func (o *GetJobsInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetJobsInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/job/job_client.go b/api/devops/devops_client/job/job_client.go new file mode 100644 index 0000000..f9b1293 --- /dev/null +++ b/api/devops/devops_client/job/job_client.go @@ -0,0 +1,258 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package job + +// 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 job API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for job 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 { + GetJob(params *GetJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetJobOK, error) + + GetJobs(params *GetJobsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetJobsOK, error) + + GetJobsObservable(params *GetJobsObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetJobsObservableOK, error) + + PostJobs(params *PostJobsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostJobsOK, error) + + PutJobs(params *PutJobsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutJobsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetJob gets a single job object + + Return a single Job object from datastore as a Singleton +*/ +func (a *Client) GetJob(params *GetJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetJobOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetJobParams() + } + op := &runtime.ClientOperation{ + ID: "getJob", + Method: "GET", + PathPattern: "/jobs/{jobIdPath}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetJobReader{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.(*GetJobOK) + 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 getJob: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetJobs gets a list jobs + + Return a list of Job records from the datastore +*/ +func (a *Client) GetJobs(params *GetJobsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetJobsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetJobsParams() + } + op := &runtime.ClientOperation{ + ID: "getJobs", + Method: "GET", + PathPattern: "/jobs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetJobsReader{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.(*GetJobsOK) + 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 getJobs: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetJobsObservable gets jobs in an observable array + + Returns a Job retrieval in a observable array +*/ +func (a *Client) GetJobsObservable(params *GetJobsObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetJobsObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetJobsObservableParams() + } + op := &runtime.ClientOperation{ + ID: "getJobsObservable", + Method: "GET", + PathPattern: "/jobs/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetJobsObservableReader{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.(*GetJobsObservableOK) + 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 getJobsObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostJobs creates new jobs + + Create and enqueue Jobs in Telnexus +*/ +func (a *Client) PostJobs(params *PostJobsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostJobsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostJobsParams() + } + op := &runtime.ClientOperation{ + ID: "postJobs", + Method: "POST", + PathPattern: "/jobs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostJobsReader{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.(*PostJobsOK) + 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 postJobs: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutJobs updates jobs + + Update Jobs in Telnexus +*/ +func (a *Client) PutJobs(params *PutJobsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutJobsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutJobsParams() + } + op := &runtime.ClientOperation{ + ID: "putJobs", + Method: "PUT", + PathPattern: "/jobs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutJobsReader{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.(*PutJobsOK) + 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 putJobs: 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 +} diff --git a/api/devops/devops_client/job/post_jobs_parameters.go b/api/devops/devops_client/job/post_jobs_parameters.go new file mode 100644 index 0000000..96b8d17 --- /dev/null +++ b/api/devops/devops_client/job/post_jobs_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package job + +// 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/telnexus/lib/api/devops/devops_models" +) + +// NewPostJobsParams creates a new PostJobsParams 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 NewPostJobsParams() *PostJobsParams { + return &PostJobsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostJobsParamsWithTimeout creates a new PostJobsParams object +// with the ability to set a timeout on a request. +func NewPostJobsParamsWithTimeout(timeout time.Duration) *PostJobsParams { + return &PostJobsParams{ + timeout: timeout, + } +} + +// NewPostJobsParamsWithContext creates a new PostJobsParams object +// with the ability to set a context for a request. +func NewPostJobsParamsWithContext(ctx context.Context) *PostJobsParams { + return &PostJobsParams{ + Context: ctx, + } +} + +// NewPostJobsParamsWithHTTPClient creates a new PostJobsParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostJobsParamsWithHTTPClient(client *http.Client) *PostJobsParams { + return &PostJobsParams{ + HTTPClient: client, + } +} + +/* PostJobsParams contains all the parameters to send to the API endpoint + for the post jobs operation. + + Typically these are written to a http.Request. +*/ +type PostJobsParams struct { + + /* JobRequest. + + An array of Job records + */ + JobRequest *devops_models.JobRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post jobs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostJobsParams) WithDefaults() *PostJobsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post jobs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostJobsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post jobs params +func (o *PostJobsParams) WithTimeout(timeout time.Duration) *PostJobsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post jobs params +func (o *PostJobsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post jobs params +func (o *PostJobsParams) WithContext(ctx context.Context) *PostJobsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post jobs params +func (o *PostJobsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post jobs params +func (o *PostJobsParams) WithHTTPClient(client *http.Client) *PostJobsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post jobs params +func (o *PostJobsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithJobRequest adds the jobRequest to the post jobs params +func (o *PostJobsParams) WithJobRequest(jobRequest *devops_models.JobRequest) *PostJobsParams { + o.SetJobRequest(jobRequest) + return o +} + +// SetJobRequest adds the jobRequest to the post jobs params +func (o *PostJobsParams) SetJobRequest(jobRequest *devops_models.JobRequest) { + o.JobRequest = jobRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostJobsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.JobRequest != nil { + if err := r.SetBodyParam(o.JobRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/job/post_jobs_responses.go b/api/devops/devops_client/job/post_jobs_responses.go new file mode 100644 index 0000000..276fc6c --- /dev/null +++ b/api/devops/devops_client/job/post_jobs_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package job + +// 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/telnexus/lib/api/devops/devops_models" +) + +// PostJobsReader is a Reader for the PostJobs structure. +type PostJobsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostJobsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostJobsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostJobsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostJobsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostJobsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostJobsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostJobsInternalServerError() + 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()) + } +} + +// NewPostJobsOK creates a PostJobsOK with default headers values +func NewPostJobsOK() *PostJobsOK { + return &PostJobsOK{} +} + +/* PostJobsOK describes a response with status code 200, with default header values. + +Telnexus Response with Job objects +*/ +type PostJobsOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.JobResponse +} + +func (o *PostJobsOK) Error() string { + return fmt.Sprintf("[POST /jobs][%d] postJobsOK %+v", 200, o.Payload) +} +func (o *PostJobsOK) GetPayload() *devops_models.JobResponse { + return o.Payload +} + +func (o *PostJobsOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.JobResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostJobsUnauthorized creates a PostJobsUnauthorized with default headers values +func NewPostJobsUnauthorized() *PostJobsUnauthorized { + return &PostJobsUnauthorized{} +} + +/* PostJobsUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostJobsUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PostJobsUnauthorized) Error() string { + return fmt.Sprintf("[POST /jobs][%d] postJobsUnauthorized %+v", 401, o.Payload) +} +func (o *PostJobsUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostJobsUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostJobsForbidden creates a PostJobsForbidden with default headers values +func NewPostJobsForbidden() *PostJobsForbidden { + return &PostJobsForbidden{} +} + +/* PostJobsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostJobsForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostJobsForbidden) Error() string { + return fmt.Sprintf("[POST /jobs][%d] postJobsForbidden %+v", 403, o.Payload) +} +func (o *PostJobsForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostJobsForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostJobsNotFound creates a PostJobsNotFound with default headers values +func NewPostJobsNotFound() *PostJobsNotFound { + return &PostJobsNotFound{} +} + +/* PostJobsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostJobsNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostJobsNotFound) Error() string { + return fmt.Sprintf("[POST /jobs][%d] postJobsNotFound %+v", 404, o.Payload) +} +func (o *PostJobsNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostJobsNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostJobsUnprocessableEntity creates a PostJobsUnprocessableEntity with default headers values +func NewPostJobsUnprocessableEntity() *PostJobsUnprocessableEntity { + return &PostJobsUnprocessableEntity{} +} + +/* PostJobsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostJobsUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PostJobsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /jobs][%d] postJobsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PostJobsUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostJobsUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostJobsInternalServerError creates a PostJobsInternalServerError with default headers values +func NewPostJobsInternalServerError() *PostJobsInternalServerError { + return &PostJobsInternalServerError{} +} + +/* PostJobsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostJobsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostJobsInternalServerError) Error() string { + return fmt.Sprintf("[POST /jobs][%d] postJobsInternalServerError %+v", 500, o.Payload) +} +func (o *PostJobsInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostJobsInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/job/put_jobs_parameters.go b/api/devops/devops_client/job/put_jobs_parameters.go new file mode 100644 index 0000000..d445704 --- /dev/null +++ b/api/devops/devops_client/job/put_jobs_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package job + +// 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/telnexus/lib/api/devops/devops_models" +) + +// NewPutJobsParams creates a new PutJobsParams 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 NewPutJobsParams() *PutJobsParams { + return &PutJobsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPutJobsParamsWithTimeout creates a new PutJobsParams object +// with the ability to set a timeout on a request. +func NewPutJobsParamsWithTimeout(timeout time.Duration) *PutJobsParams { + return &PutJobsParams{ + timeout: timeout, + } +} + +// NewPutJobsParamsWithContext creates a new PutJobsParams object +// with the ability to set a context for a request. +func NewPutJobsParamsWithContext(ctx context.Context) *PutJobsParams { + return &PutJobsParams{ + Context: ctx, + } +} + +// NewPutJobsParamsWithHTTPClient creates a new PutJobsParams object +// with the ability to set a custom HTTPClient for a request. +func NewPutJobsParamsWithHTTPClient(client *http.Client) *PutJobsParams { + return &PutJobsParams{ + HTTPClient: client, + } +} + +/* PutJobsParams contains all the parameters to send to the API endpoint + for the put jobs operation. + + Typically these are written to a http.Request. +*/ +type PutJobsParams struct { + + /* JobRequest. + + An array of Job records + */ + JobRequest *devops_models.JobRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put jobs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutJobsParams) WithDefaults() *PutJobsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put jobs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutJobsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the put jobs params +func (o *PutJobsParams) WithTimeout(timeout time.Duration) *PutJobsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put jobs params +func (o *PutJobsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put jobs params +func (o *PutJobsParams) WithContext(ctx context.Context) *PutJobsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put jobs params +func (o *PutJobsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put jobs params +func (o *PutJobsParams) WithHTTPClient(client *http.Client) *PutJobsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put jobs params +func (o *PutJobsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithJobRequest adds the jobRequest to the put jobs params +func (o *PutJobsParams) WithJobRequest(jobRequest *devops_models.JobRequest) *PutJobsParams { + o.SetJobRequest(jobRequest) + return o +} + +// SetJobRequest adds the jobRequest to the put jobs params +func (o *PutJobsParams) SetJobRequest(jobRequest *devops_models.JobRequest) { + o.JobRequest = jobRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutJobsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.JobRequest != nil { + if err := r.SetBodyParam(o.JobRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/job/put_jobs_responses.go b/api/devops/devops_client/job/put_jobs_responses.go new file mode 100644 index 0000000..39bd939 --- /dev/null +++ b/api/devops/devops_client/job/put_jobs_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package job + +// 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/telnexus/lib/api/devops/devops_models" +) + +// PutJobsReader is a Reader for the PutJobs structure. +type PutJobsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutJobsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutJobsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutJobsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutJobsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutJobsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutJobsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutJobsInternalServerError() + 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()) + } +} + +// NewPutJobsOK creates a PutJobsOK with default headers values +func NewPutJobsOK() *PutJobsOK { + return &PutJobsOK{} +} + +/* PutJobsOK describes a response with status code 200, with default header values. + +Telnexus Response with Job objects +*/ +type PutJobsOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.JobResponse +} + +func (o *PutJobsOK) Error() string { + return fmt.Sprintf("[PUT /jobs][%d] putJobsOK %+v", 200, o.Payload) +} +func (o *PutJobsOK) GetPayload() *devops_models.JobResponse { + return o.Payload +} + +func (o *PutJobsOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.JobResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutJobsUnauthorized creates a PutJobsUnauthorized with default headers values +func NewPutJobsUnauthorized() *PutJobsUnauthorized { + return &PutJobsUnauthorized{} +} + +/* PutJobsUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutJobsUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PutJobsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /jobs][%d] putJobsUnauthorized %+v", 401, o.Payload) +} +func (o *PutJobsUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutJobsUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutJobsForbidden creates a PutJobsForbidden with default headers values +func NewPutJobsForbidden() *PutJobsForbidden { + return &PutJobsForbidden{} +} + +/* PutJobsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PutJobsForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PutJobsForbidden) Error() string { + return fmt.Sprintf("[PUT /jobs][%d] putJobsForbidden %+v", 403, o.Payload) +} +func (o *PutJobsForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutJobsForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutJobsNotFound creates a PutJobsNotFound with default headers values +func NewPutJobsNotFound() *PutJobsNotFound { + return &PutJobsNotFound{} +} + +/* PutJobsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PutJobsNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PutJobsNotFound) Error() string { + return fmt.Sprintf("[PUT /jobs][%d] putJobsNotFound %+v", 404, o.Payload) +} +func (o *PutJobsNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutJobsNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutJobsUnprocessableEntity creates a PutJobsUnprocessableEntity with default headers values +func NewPutJobsUnprocessableEntity() *PutJobsUnprocessableEntity { + return &PutJobsUnprocessableEntity{} +} + +/* PutJobsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutJobsUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PutJobsUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /jobs][%d] putJobsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PutJobsUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutJobsUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutJobsInternalServerError creates a PutJobsInternalServerError with default headers values +func NewPutJobsInternalServerError() *PutJobsInternalServerError { + return &PutJobsInternalServerError{} +} + +/* PutJobsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PutJobsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PutJobsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /jobs][%d] putJobsInternalServerError %+v", 500, o.Payload) +} +func (o *PutJobsInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutJobsInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/service/get_service_parameters.go b/api/devops/devops_client/service/get_service_parameters.go new file mode 100644 index 0000000..cf501a9 --- /dev/null +++ b/api/devops/devops_client/service/get_service_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package service + +// 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" +) + +// NewGetServiceParams creates a new GetServiceParams 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 NewGetServiceParams() *GetServiceParams { + return &GetServiceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetServiceParamsWithTimeout creates a new GetServiceParams object +// with the ability to set a timeout on a request. +func NewGetServiceParamsWithTimeout(timeout time.Duration) *GetServiceParams { + return &GetServiceParams{ + timeout: timeout, + } +} + +// NewGetServiceParamsWithContext creates a new GetServiceParams object +// with the ability to set a context for a request. +func NewGetServiceParamsWithContext(ctx context.Context) *GetServiceParams { + return &GetServiceParams{ + Context: ctx, + } +} + +// NewGetServiceParamsWithHTTPClient creates a new GetServiceParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetServiceParamsWithHTTPClient(client *http.Client) *GetServiceParams { + return &GetServiceParams{ + HTTPClient: client, + } +} + +/* GetServiceParams contains all the parameters to send to the API endpoint + for the get service operation. + + Typically these are written to a http.Request. +*/ +type GetServiceParams struct { + + /* ServiceIDPath. + + Telnexus Record Id of a Service + */ + ServiceIDPath string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetServiceParams) WithDefaults() *GetServiceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetServiceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get service params +func (o *GetServiceParams) WithTimeout(timeout time.Duration) *GetServiceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get service params +func (o *GetServiceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get service params +func (o *GetServiceParams) WithContext(ctx context.Context) *GetServiceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get service params +func (o *GetServiceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get service params +func (o *GetServiceParams) WithHTTPClient(client *http.Client) *GetServiceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get service params +func (o *GetServiceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithServiceIDPath adds the serviceIDPath to the get service params +func (o *GetServiceParams) WithServiceIDPath(serviceIDPath string) *GetServiceParams { + o.SetServiceIDPath(serviceIDPath) + return o +} + +// SetServiceIDPath adds the serviceIdPath to the get service params +func (o *GetServiceParams) SetServiceIDPath(serviceIDPath string) { + o.ServiceIDPath = serviceIDPath +} + +// WriteToRequest writes these params to a swagger request +func (o *GetServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param serviceIdPath + if err := r.SetPathParam("serviceIdPath", o.ServiceIDPath); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/service/get_service_responses.go b/api/devops/devops_client/service/get_service_responses.go new file mode 100644 index 0000000..77870cd --- /dev/null +++ b/api/devops/devops_client/service/get_service_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package service + +// 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/telnexus/lib/api/devops/devops_models" +) + +// GetServiceReader is a Reader for the GetService structure. +type GetServiceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetServiceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetServiceUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetServiceForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetServiceNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetServiceUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetServiceInternalServerError() + 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()) + } +} + +// NewGetServiceOK creates a GetServiceOK with default headers values +func NewGetServiceOK() *GetServiceOK { + return &GetServiceOK{} +} + +/* GetServiceOK describes a response with status code 200, with default header values. + +Single Service record response +*/ +type GetServiceOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Service +} + +func (o *GetServiceOK) Error() string { + return fmt.Sprintf("[GET /services/{serviceIdPath}][%d] getServiceOK %+v", 200, o.Payload) +} +func (o *GetServiceOK) GetPayload() *devops_models.Service { + return o.Payload +} + +func (o *GetServiceOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Service) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetServiceUnauthorized creates a GetServiceUnauthorized with default headers values +func NewGetServiceUnauthorized() *GetServiceUnauthorized { + return &GetServiceUnauthorized{} +} + +/* GetServiceUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetServiceUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetServiceUnauthorized) Error() string { + return fmt.Sprintf("[GET /services/{serviceIdPath}][%d] getServiceUnauthorized %+v", 401, o.Payload) +} +func (o *GetServiceUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetServiceUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetServiceForbidden creates a GetServiceForbidden with default headers values +func NewGetServiceForbidden() *GetServiceForbidden { + return &GetServiceForbidden{} +} + +/* GetServiceForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetServiceForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetServiceForbidden) Error() string { + return fmt.Sprintf("[GET /services/{serviceIdPath}][%d] getServiceForbidden %+v", 403, o.Payload) +} +func (o *GetServiceForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetServiceForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetServiceNotFound creates a GetServiceNotFound with default headers values +func NewGetServiceNotFound() *GetServiceNotFound { + return &GetServiceNotFound{} +} + +/* GetServiceNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetServiceNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetServiceNotFound) Error() string { + return fmt.Sprintf("[GET /services/{serviceIdPath}][%d] getServiceNotFound %+v", 404, o.Payload) +} +func (o *GetServiceNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetServiceNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetServiceUnprocessableEntity creates a GetServiceUnprocessableEntity with default headers values +func NewGetServiceUnprocessableEntity() *GetServiceUnprocessableEntity { + return &GetServiceUnprocessableEntity{} +} + +/* GetServiceUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetServiceUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetServiceUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /services/{serviceIdPath}][%d] getServiceUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetServiceUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetServiceUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetServiceInternalServerError creates a GetServiceInternalServerError with default headers values +func NewGetServiceInternalServerError() *GetServiceInternalServerError { + return &GetServiceInternalServerError{} +} + +/* GetServiceInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetServiceInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetServiceInternalServerError) Error() string { + return fmt.Sprintf("[GET /services/{serviceIdPath}][%d] getServiceInternalServerError %+v", 500, o.Payload) +} +func (o *GetServiceInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetServiceInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/service/get_services_observable_parameters.go b/api/devops/devops_client/service/get_services_observable_parameters.go new file mode 100644 index 0000000..d0173c5 --- /dev/null +++ b/api/devops/devops_client/service/get_services_observable_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package service + +// 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" +) + +// NewGetServicesObservableParams creates a new GetServicesObservableParams 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 NewGetServicesObservableParams() *GetServicesObservableParams { + return &GetServicesObservableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetServicesObservableParamsWithTimeout creates a new GetServicesObservableParams object +// with the ability to set a timeout on a request. +func NewGetServicesObservableParamsWithTimeout(timeout time.Duration) *GetServicesObservableParams { + return &GetServicesObservableParams{ + timeout: timeout, + } +} + +// NewGetServicesObservableParamsWithContext creates a new GetServicesObservableParams object +// with the ability to set a context for a request. +func NewGetServicesObservableParamsWithContext(ctx context.Context) *GetServicesObservableParams { + return &GetServicesObservableParams{ + Context: ctx, + } +} + +// NewGetServicesObservableParamsWithHTTPClient creates a new GetServicesObservableParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetServicesObservableParamsWithHTTPClient(client *http.Client) *GetServicesObservableParams { + return &GetServicesObservableParams{ + HTTPClient: client, + } +} + +/* GetServicesObservableParams contains all the parameters to send to the API endpoint + for the get services observable operation. + + Typically these are written to a http.Request. +*/ +type GetServicesObservableParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get services observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetServicesObservableParams) WithDefaults() *GetServicesObservableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get services observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetServicesObservableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get services observable params +func (o *GetServicesObservableParams) WithTimeout(timeout time.Duration) *GetServicesObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get services observable params +func (o *GetServicesObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get services observable params +func (o *GetServicesObservableParams) WithContext(ctx context.Context) *GetServicesObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get services observable params +func (o *GetServicesObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get services observable params +func (o *GetServicesObservableParams) WithHTTPClient(client *http.Client) *GetServicesObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get services observable params +func (o *GetServicesObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetServicesObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/service/get_services_observable_responses.go b/api/devops/devops_client/service/get_services_observable_responses.go new file mode 100644 index 0000000..2ac38b6 --- /dev/null +++ b/api/devops/devops_client/service/get_services_observable_responses.go @@ -0,0 +1,337 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package service + +// 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/telnexus/lib/api/devops/devops_models" +) + +// GetServicesObservableReader is a Reader for the GetServicesObservable structure. +type GetServicesObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetServicesObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetServicesObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetServicesObservableUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetServicesObservableForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetServicesObservableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetServicesObservableUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetServicesObservableInternalServerError() + 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()) + } +} + +// NewGetServicesObservableOK creates a GetServicesObservableOK with default headers values +func NewGetServicesObservableOK() *GetServicesObservableOK { + return &GetServicesObservableOK{} +} + +/* GetServicesObservableOK describes a response with status code 200, with default header values. + +Simple Service record response +*/ +type GetServicesObservableOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload []*devops_models.Service +} + +func (o *GetServicesObservableOK) Error() string { + return fmt.Sprintf("[GET /services/observable][%d] getServicesObservableOK %+v", 200, o.Payload) +} +func (o *GetServicesObservableOK) GetPayload() []*devops_models.Service { + return o.Payload +} + +func (o *GetServicesObservableOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetServicesObservableUnauthorized creates a GetServicesObservableUnauthorized with default headers values +func NewGetServicesObservableUnauthorized() *GetServicesObservableUnauthorized { + return &GetServicesObservableUnauthorized{} +} + +/* GetServicesObservableUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetServicesObservableUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetServicesObservableUnauthorized) Error() string { + return fmt.Sprintf("[GET /services/observable][%d] getServicesObservableUnauthorized %+v", 401, o.Payload) +} +func (o *GetServicesObservableUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetServicesObservableUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetServicesObservableForbidden creates a GetServicesObservableForbidden with default headers values +func NewGetServicesObservableForbidden() *GetServicesObservableForbidden { + return &GetServicesObservableForbidden{} +} + +/* GetServicesObservableForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetServicesObservableForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetServicesObservableForbidden) Error() string { + return fmt.Sprintf("[GET /services/observable][%d] getServicesObservableForbidden %+v", 403, o.Payload) +} +func (o *GetServicesObservableForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetServicesObservableForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetServicesObservableNotFound creates a GetServicesObservableNotFound with default headers values +func NewGetServicesObservableNotFound() *GetServicesObservableNotFound { + return &GetServicesObservableNotFound{} +} + +/* GetServicesObservableNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetServicesObservableNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetServicesObservableNotFound) Error() string { + return fmt.Sprintf("[GET /services/observable][%d] getServicesObservableNotFound %+v", 404, o.Payload) +} +func (o *GetServicesObservableNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetServicesObservableNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetServicesObservableUnprocessableEntity creates a GetServicesObservableUnprocessableEntity with default headers values +func NewGetServicesObservableUnprocessableEntity() *GetServicesObservableUnprocessableEntity { + return &GetServicesObservableUnprocessableEntity{} +} + +/* GetServicesObservableUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetServicesObservableUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetServicesObservableUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /services/observable][%d] getServicesObservableUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetServicesObservableUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetServicesObservableUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetServicesObservableInternalServerError creates a GetServicesObservableInternalServerError with default headers values +func NewGetServicesObservableInternalServerError() *GetServicesObservableInternalServerError { + return &GetServicesObservableInternalServerError{} +} + +/* GetServicesObservableInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetServicesObservableInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetServicesObservableInternalServerError) Error() string { + return fmt.Sprintf("[GET /services/observable][%d] getServicesObservableInternalServerError %+v", 500, o.Payload) +} +func (o *GetServicesObservableInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetServicesObservableInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/service/get_services_parameters.go b/api/devops/devops_client/service/get_services_parameters.go new file mode 100644 index 0000000..821bb3f --- /dev/null +++ b/api/devops/devops_client/service/get_services_parameters.go @@ -0,0 +1,238 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package service + +// 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" +) + +// NewGetServicesParams creates a new GetServicesParams 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 NewGetServicesParams() *GetServicesParams { + return &GetServicesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetServicesParamsWithTimeout creates a new GetServicesParams object +// with the ability to set a timeout on a request. +func NewGetServicesParamsWithTimeout(timeout time.Duration) *GetServicesParams { + return &GetServicesParams{ + timeout: timeout, + } +} + +// NewGetServicesParamsWithContext creates a new GetServicesParams object +// with the ability to set a context for a request. +func NewGetServicesParamsWithContext(ctx context.Context) *GetServicesParams { + return &GetServicesParams{ + Context: ctx, + } +} + +// NewGetServicesParamsWithHTTPClient creates a new GetServicesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetServicesParamsWithHTTPClient(client *http.Client) *GetServicesParams { + return &GetServicesParams{ + HTTPClient: client, + } +} + +/* GetServicesParams contains all the parameters to send to the API endpoint + for the get services operation. + + Typically these are written to a http.Request. +*/ +type GetServicesParams struct { + + /* Limit. + + How many objects to return at one time + + Format: int64 + */ + Limit *int64 + + /* Offset. + + How many objects to skip? (default 0) + + Format: int64 + */ + Offset *int64 + + /* ServiceID. + + Service ID + */ + ServiceID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get services params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetServicesParams) WithDefaults() *GetServicesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get services params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetServicesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get services params +func (o *GetServicesParams) WithTimeout(timeout time.Duration) *GetServicesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get services params +func (o *GetServicesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get services params +func (o *GetServicesParams) WithContext(ctx context.Context) *GetServicesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get services params +func (o *GetServicesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get services params +func (o *GetServicesParams) WithHTTPClient(client *http.Client) *GetServicesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get services params +func (o *GetServicesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the get services params +func (o *GetServicesParams) WithLimit(limit *int64) *GetServicesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get services params +func (o *GetServicesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get services params +func (o *GetServicesParams) WithOffset(offset *int64) *GetServicesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get services params +func (o *GetServicesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithServiceID adds the serviceID to the get services params +func (o *GetServicesParams) WithServiceID(serviceID *string) *GetServicesParams { + o.SetServiceID(serviceID) + return o +} + +// SetServiceID adds the serviceId to the get services params +func (o *GetServicesParams) SetServiceID(serviceID *string) { + o.ServiceID = serviceID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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 o.ServiceID != nil { + + // query param serviceId + var qrServiceID string + + if o.ServiceID != nil { + qrServiceID = *o.ServiceID + } + qServiceID := qrServiceID + if qServiceID != "" { + + if err := r.SetQueryParam("serviceId", qServiceID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/service/get_services_responses.go b/api/devops/devops_client/service/get_services_responses.go new file mode 100644 index 0000000..71bad1c --- /dev/null +++ b/api/devops/devops_client/service/get_services_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package service + +// 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/telnexus/lib/api/devops/devops_models" +) + +// GetServicesReader is a Reader for the GetServices structure. +type GetServicesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetServicesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetServicesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetServicesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetServicesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetServicesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetServicesInternalServerError() + 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()) + } +} + +// NewGetServicesOK creates a GetServicesOK with default headers values +func NewGetServicesOK() *GetServicesOK { + return &GetServicesOK{} +} + +/* GetServicesOK describes a response with status code 200, with default header values. + +Telnexus Response with Service objects +*/ +type GetServicesOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.ServiceResponse +} + +func (o *GetServicesOK) Error() string { + return fmt.Sprintf("[GET /services][%d] getServicesOK %+v", 200, o.Payload) +} +func (o *GetServicesOK) GetPayload() *devops_models.ServiceResponse { + return o.Payload +} + +func (o *GetServicesOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.ServiceResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetServicesUnauthorized creates a GetServicesUnauthorized with default headers values +func NewGetServicesUnauthorized() *GetServicesUnauthorized { + return &GetServicesUnauthorized{} +} + +/* GetServicesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetServicesUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetServicesUnauthorized) Error() string { + return fmt.Sprintf("[GET /services][%d] getServicesUnauthorized %+v", 401, o.Payload) +} +func (o *GetServicesUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetServicesUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetServicesForbidden creates a GetServicesForbidden with default headers values +func NewGetServicesForbidden() *GetServicesForbidden { + return &GetServicesForbidden{} +} + +/* GetServicesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetServicesForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetServicesForbidden) Error() string { + return fmt.Sprintf("[GET /services][%d] getServicesForbidden %+v", 403, o.Payload) +} +func (o *GetServicesForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetServicesForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetServicesNotFound creates a GetServicesNotFound with default headers values +func NewGetServicesNotFound() *GetServicesNotFound { + return &GetServicesNotFound{} +} + +/* GetServicesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetServicesNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetServicesNotFound) Error() string { + return fmt.Sprintf("[GET /services][%d] getServicesNotFound %+v", 404, o.Payload) +} +func (o *GetServicesNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetServicesNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetServicesUnprocessableEntity creates a GetServicesUnprocessableEntity with default headers values +func NewGetServicesUnprocessableEntity() *GetServicesUnprocessableEntity { + return &GetServicesUnprocessableEntity{} +} + +/* GetServicesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetServicesUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetServicesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /services][%d] getServicesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetServicesUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetServicesUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetServicesInternalServerError creates a GetServicesInternalServerError with default headers values +func NewGetServicesInternalServerError() *GetServicesInternalServerError { + return &GetServicesInternalServerError{} +} + +/* GetServicesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetServicesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetServicesInternalServerError) Error() string { + return fmt.Sprintf("[GET /services][%d] getServicesInternalServerError %+v", 500, o.Payload) +} +func (o *GetServicesInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetServicesInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/service/post_services_parameters.go b/api/devops/devops_client/service/post_services_parameters.go new file mode 100644 index 0000000..ee67076 --- /dev/null +++ b/api/devops/devops_client/service/post_services_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package service + +// 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/telnexus/lib/api/devops/devops_models" +) + +// NewPostServicesParams creates a new PostServicesParams 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 NewPostServicesParams() *PostServicesParams { + return &PostServicesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostServicesParamsWithTimeout creates a new PostServicesParams object +// with the ability to set a timeout on a request. +func NewPostServicesParamsWithTimeout(timeout time.Duration) *PostServicesParams { + return &PostServicesParams{ + timeout: timeout, + } +} + +// NewPostServicesParamsWithContext creates a new PostServicesParams object +// with the ability to set a context for a request. +func NewPostServicesParamsWithContext(ctx context.Context) *PostServicesParams { + return &PostServicesParams{ + Context: ctx, + } +} + +// NewPostServicesParamsWithHTTPClient creates a new PostServicesParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostServicesParamsWithHTTPClient(client *http.Client) *PostServicesParams { + return &PostServicesParams{ + HTTPClient: client, + } +} + +/* PostServicesParams contains all the parameters to send to the API endpoint + for the post services operation. + + Typically these are written to a http.Request. +*/ +type PostServicesParams struct { + + /* ServiceRequest. + + An array of Service records + */ + ServiceRequest *devops_models.ServiceRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post services params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostServicesParams) WithDefaults() *PostServicesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post services params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostServicesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post services params +func (o *PostServicesParams) WithTimeout(timeout time.Duration) *PostServicesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post services params +func (o *PostServicesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post services params +func (o *PostServicesParams) WithContext(ctx context.Context) *PostServicesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post services params +func (o *PostServicesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post services params +func (o *PostServicesParams) WithHTTPClient(client *http.Client) *PostServicesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post services params +func (o *PostServicesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithServiceRequest adds the serviceRequest to the post services params +func (o *PostServicesParams) WithServiceRequest(serviceRequest *devops_models.ServiceRequest) *PostServicesParams { + o.SetServiceRequest(serviceRequest) + return o +} + +// SetServiceRequest adds the serviceRequest to the post services params +func (o *PostServicesParams) SetServiceRequest(serviceRequest *devops_models.ServiceRequest) { + o.ServiceRequest = serviceRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.ServiceRequest != nil { + if err := r.SetBodyParam(o.ServiceRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/service/post_services_responses.go b/api/devops/devops_client/service/post_services_responses.go new file mode 100644 index 0000000..79545b1 --- /dev/null +++ b/api/devops/devops_client/service/post_services_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package service + +// 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/telnexus/lib/api/devops/devops_models" +) + +// PostServicesReader is a Reader for the PostServices structure. +type PostServicesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostServicesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostServicesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostServicesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostServicesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostServicesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostServicesInternalServerError() + 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()) + } +} + +// NewPostServicesOK creates a PostServicesOK with default headers values +func NewPostServicesOK() *PostServicesOK { + return &PostServicesOK{} +} + +/* PostServicesOK describes a response with status code 200, with default header values. + +Telnexus Response with Service objects +*/ +type PostServicesOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.ServiceResponse +} + +func (o *PostServicesOK) Error() string { + return fmt.Sprintf("[POST /services][%d] postServicesOK %+v", 200, o.Payload) +} +func (o *PostServicesOK) GetPayload() *devops_models.ServiceResponse { + return o.Payload +} + +func (o *PostServicesOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.ServiceResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostServicesUnauthorized creates a PostServicesUnauthorized with default headers values +func NewPostServicesUnauthorized() *PostServicesUnauthorized { + return &PostServicesUnauthorized{} +} + +/* PostServicesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostServicesUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PostServicesUnauthorized) Error() string { + return fmt.Sprintf("[POST /services][%d] postServicesUnauthorized %+v", 401, o.Payload) +} +func (o *PostServicesUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostServicesUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostServicesForbidden creates a PostServicesForbidden with default headers values +func NewPostServicesForbidden() *PostServicesForbidden { + return &PostServicesForbidden{} +} + +/* PostServicesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostServicesForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostServicesForbidden) Error() string { + return fmt.Sprintf("[POST /services][%d] postServicesForbidden %+v", 403, o.Payload) +} +func (o *PostServicesForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostServicesForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostServicesNotFound creates a PostServicesNotFound with default headers values +func NewPostServicesNotFound() *PostServicesNotFound { + return &PostServicesNotFound{} +} + +/* PostServicesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostServicesNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostServicesNotFound) Error() string { + return fmt.Sprintf("[POST /services][%d] postServicesNotFound %+v", 404, o.Payload) +} +func (o *PostServicesNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostServicesNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostServicesUnprocessableEntity creates a PostServicesUnprocessableEntity with default headers values +func NewPostServicesUnprocessableEntity() *PostServicesUnprocessableEntity { + return &PostServicesUnprocessableEntity{} +} + +/* PostServicesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostServicesUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PostServicesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /services][%d] postServicesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PostServicesUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostServicesUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostServicesInternalServerError creates a PostServicesInternalServerError with default headers values +func NewPostServicesInternalServerError() *PostServicesInternalServerError { + return &PostServicesInternalServerError{} +} + +/* PostServicesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostServicesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostServicesInternalServerError) Error() string { + return fmt.Sprintf("[POST /services][%d] postServicesInternalServerError %+v", 500, o.Payload) +} +func (o *PostServicesInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostServicesInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/service/put_services_parameters.go b/api/devops/devops_client/service/put_services_parameters.go new file mode 100644 index 0000000..e1474d6 --- /dev/null +++ b/api/devops/devops_client/service/put_services_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package service + +// 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/telnexus/lib/api/devops/devops_models" +) + +// NewPutServicesParams creates a new PutServicesParams 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 NewPutServicesParams() *PutServicesParams { + return &PutServicesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPutServicesParamsWithTimeout creates a new PutServicesParams object +// with the ability to set a timeout on a request. +func NewPutServicesParamsWithTimeout(timeout time.Duration) *PutServicesParams { + return &PutServicesParams{ + timeout: timeout, + } +} + +// NewPutServicesParamsWithContext creates a new PutServicesParams object +// with the ability to set a context for a request. +func NewPutServicesParamsWithContext(ctx context.Context) *PutServicesParams { + return &PutServicesParams{ + Context: ctx, + } +} + +// NewPutServicesParamsWithHTTPClient creates a new PutServicesParams object +// with the ability to set a custom HTTPClient for a request. +func NewPutServicesParamsWithHTTPClient(client *http.Client) *PutServicesParams { + return &PutServicesParams{ + HTTPClient: client, + } +} + +/* PutServicesParams contains all the parameters to send to the API endpoint + for the put services operation. + + Typically these are written to a http.Request. +*/ +type PutServicesParams struct { + + /* ServiceRequest. + + An array of Service records + */ + ServiceRequest *devops_models.ServiceRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put services params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutServicesParams) WithDefaults() *PutServicesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put services params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutServicesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the put services params +func (o *PutServicesParams) WithTimeout(timeout time.Duration) *PutServicesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put services params +func (o *PutServicesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put services params +func (o *PutServicesParams) WithContext(ctx context.Context) *PutServicesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put services params +func (o *PutServicesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put services params +func (o *PutServicesParams) WithHTTPClient(client *http.Client) *PutServicesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put services params +func (o *PutServicesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithServiceRequest adds the serviceRequest to the put services params +func (o *PutServicesParams) WithServiceRequest(serviceRequest *devops_models.ServiceRequest) *PutServicesParams { + o.SetServiceRequest(serviceRequest) + return o +} + +// SetServiceRequest adds the serviceRequest to the put services params +func (o *PutServicesParams) SetServiceRequest(serviceRequest *devops_models.ServiceRequest) { + o.ServiceRequest = serviceRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.ServiceRequest != nil { + if err := r.SetBodyParam(o.ServiceRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/service/put_services_responses.go b/api/devops/devops_client/service/put_services_responses.go new file mode 100644 index 0000000..9ae0835 --- /dev/null +++ b/api/devops/devops_client/service/put_services_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package service + +// 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/telnexus/lib/api/devops/devops_models" +) + +// PutServicesReader is a Reader for the PutServices structure. +type PutServicesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutServicesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutServicesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutServicesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutServicesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutServicesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutServicesInternalServerError() + 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()) + } +} + +// NewPutServicesOK creates a PutServicesOK with default headers values +func NewPutServicesOK() *PutServicesOK { + return &PutServicesOK{} +} + +/* PutServicesOK describes a response with status code 200, with default header values. + +Telnexus Response with Service objects +*/ +type PutServicesOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.ServiceResponse +} + +func (o *PutServicesOK) Error() string { + return fmt.Sprintf("[PUT /services][%d] putServicesOK %+v", 200, o.Payload) +} +func (o *PutServicesOK) GetPayload() *devops_models.ServiceResponse { + return o.Payload +} + +func (o *PutServicesOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.ServiceResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutServicesUnauthorized creates a PutServicesUnauthorized with default headers values +func NewPutServicesUnauthorized() *PutServicesUnauthorized { + return &PutServicesUnauthorized{} +} + +/* PutServicesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutServicesUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PutServicesUnauthorized) Error() string { + return fmt.Sprintf("[PUT /services][%d] putServicesUnauthorized %+v", 401, o.Payload) +} +func (o *PutServicesUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutServicesUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutServicesForbidden creates a PutServicesForbidden with default headers values +func NewPutServicesForbidden() *PutServicesForbidden { + return &PutServicesForbidden{} +} + +/* PutServicesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PutServicesForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PutServicesForbidden) Error() string { + return fmt.Sprintf("[PUT /services][%d] putServicesForbidden %+v", 403, o.Payload) +} +func (o *PutServicesForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutServicesForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutServicesNotFound creates a PutServicesNotFound with default headers values +func NewPutServicesNotFound() *PutServicesNotFound { + return &PutServicesNotFound{} +} + +/* PutServicesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PutServicesNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PutServicesNotFound) Error() string { + return fmt.Sprintf("[PUT /services][%d] putServicesNotFound %+v", 404, o.Payload) +} +func (o *PutServicesNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutServicesNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutServicesUnprocessableEntity creates a PutServicesUnprocessableEntity with default headers values +func NewPutServicesUnprocessableEntity() *PutServicesUnprocessableEntity { + return &PutServicesUnprocessableEntity{} +} + +/* PutServicesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutServicesUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PutServicesUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /services][%d] putServicesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PutServicesUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutServicesUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutServicesInternalServerError creates a PutServicesInternalServerError with default headers values +func NewPutServicesInternalServerError() *PutServicesInternalServerError { + return &PutServicesInternalServerError{} +} + +/* PutServicesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PutServicesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PutServicesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /services][%d] putServicesInternalServerError %+v", 500, o.Payload) +} +func (o *PutServicesInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutServicesInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/service/service_client.go b/api/devops/devops_client/service/service_client.go new file mode 100644 index 0000000..213e711 --- /dev/null +++ b/api/devops/devops_client/service/service_client.go @@ -0,0 +1,258 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package service + +// 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 service API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for service 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 { + GetService(params *GetServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetServiceOK, error) + + GetServices(params *GetServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetServicesOK, error) + + GetServicesObservable(params *GetServicesObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetServicesObservableOK, error) + + PostServices(params *PostServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostServicesOK, error) + + PutServices(params *PutServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutServicesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetService gets a single service object + + Return a single Service object from datastore as a Singleton +*/ +func (a *Client) GetService(params *GetServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetServiceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetServiceParams() + } + op := &runtime.ClientOperation{ + ID: "getService", + Method: "GET", + PathPattern: "/services/{serviceIdPath}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetServiceReader{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.(*GetServiceOK) + 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 getService: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetServices gets a list of services + + Return a list of Services records from the datastore +*/ +func (a *Client) GetServices(params *GetServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetServicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetServicesParams() + } + op := &runtime.ClientOperation{ + ID: "getServices", + Method: "GET", + PathPattern: "/services", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetServicesReader{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.(*GetServicesOK) + 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 getServices: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetServicesObservable gets services in an observable array + + Returns a Service retrieval in a observable array +*/ +func (a *Client) GetServicesObservable(params *GetServicesObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetServicesObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetServicesObservableParams() + } + op := &runtime.ClientOperation{ + ID: "getServicesObservable", + Method: "GET", + PathPattern: "/services/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetServicesObservableReader{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.(*GetServicesObservableOK) + 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 getServicesObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostServices creates new services + + Create Services in Telnexus +*/ +func (a *Client) PostServices(params *PostServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostServicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostServicesParams() + } + op := &runtime.ClientOperation{ + ID: "postServices", + Method: "POST", + PathPattern: "/services", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostServicesReader{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.(*PostServicesOK) + 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 postServices: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutServices updates services + + Update Services in Telnexus +*/ +func (a *Client) PutServices(params *PutServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutServicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutServicesParams() + } + op := &runtime.ClientOperation{ + ID: "putServices", + Method: "PUT", + PathPattern: "/services", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutServicesReader{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.(*PutServicesOK) + 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 putServices: 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 +} diff --git a/api/devops/devops_client/template/get_template_parameters.go b/api/devops/devops_client/template/get_template_parameters.go new file mode 100644 index 0000000..38efb7f --- /dev/null +++ b/api/devops/devops_client/template/get_template_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package template + +// 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" +) + +// NewGetTemplateParams creates a new GetTemplateParams 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 NewGetTemplateParams() *GetTemplateParams { + return &GetTemplateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTemplateParamsWithTimeout creates a new GetTemplateParams object +// with the ability to set a timeout on a request. +func NewGetTemplateParamsWithTimeout(timeout time.Duration) *GetTemplateParams { + return &GetTemplateParams{ + timeout: timeout, + } +} + +// NewGetTemplateParamsWithContext creates a new GetTemplateParams object +// with the ability to set a context for a request. +func NewGetTemplateParamsWithContext(ctx context.Context) *GetTemplateParams { + return &GetTemplateParams{ + Context: ctx, + } +} + +// NewGetTemplateParamsWithHTTPClient creates a new GetTemplateParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTemplateParamsWithHTTPClient(client *http.Client) *GetTemplateParams { + return &GetTemplateParams{ + HTTPClient: client, + } +} + +/* GetTemplateParams contains all the parameters to send to the API endpoint + for the get template operation. + + Typically these are written to a http.Request. +*/ +type GetTemplateParams struct { + + /* TemplateIDPath. + + Telnexus Record Id of a Template + */ + TemplateIDPath string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTemplateParams) WithDefaults() *GetTemplateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTemplateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get template params +func (o *GetTemplateParams) WithTimeout(timeout time.Duration) *GetTemplateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get template params +func (o *GetTemplateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get template params +func (o *GetTemplateParams) WithContext(ctx context.Context) *GetTemplateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get template params +func (o *GetTemplateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get template params +func (o *GetTemplateParams) WithHTTPClient(client *http.Client) *GetTemplateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get template params +func (o *GetTemplateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTemplateIDPath adds the templateIDPath to the get template params +func (o *GetTemplateParams) WithTemplateIDPath(templateIDPath string) *GetTemplateParams { + o.SetTemplateIDPath(templateIDPath) + return o +} + +// SetTemplateIDPath adds the templateIdPath to the get template params +func (o *GetTemplateParams) SetTemplateIDPath(templateIDPath string) { + o.TemplateIDPath = templateIDPath +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTemplateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param templateIdPath + if err := r.SetPathParam("templateIdPath", o.TemplateIDPath); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/template/get_template_responses.go b/api/devops/devops_client/template/get_template_responses.go new file mode 100644 index 0000000..fdd5776 --- /dev/null +++ b/api/devops/devops_client/template/get_template_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package template + +// 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/telnexus/lib/api/devops/devops_models" +) + +// GetTemplateReader is a Reader for the GetTemplate structure. +type GetTemplateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTemplateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTemplateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTemplateUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetTemplateForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTemplateNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetTemplateUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTemplateInternalServerError() + 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()) + } +} + +// NewGetTemplateOK creates a GetTemplateOK with default headers values +func NewGetTemplateOK() *GetTemplateOK { + return &GetTemplateOK{} +} + +/* GetTemplateOK describes a response with status code 200, with default header values. + +Single Template record response +*/ +type GetTemplateOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Template +} + +func (o *GetTemplateOK) Error() string { + return fmt.Sprintf("[GET /templates/{templateIdPath}][%d] getTemplateOK %+v", 200, o.Payload) +} +func (o *GetTemplateOK) GetPayload() *devops_models.Template { + return o.Payload +} + +func (o *GetTemplateOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Template) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTemplateUnauthorized creates a GetTemplateUnauthorized with default headers values +func NewGetTemplateUnauthorized() *GetTemplateUnauthorized { + return &GetTemplateUnauthorized{} +} + +/* GetTemplateUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetTemplateUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetTemplateUnauthorized) Error() string { + return fmt.Sprintf("[GET /templates/{templateIdPath}][%d] getTemplateUnauthorized %+v", 401, o.Payload) +} +func (o *GetTemplateUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTemplateUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTemplateForbidden creates a GetTemplateForbidden with default headers values +func NewGetTemplateForbidden() *GetTemplateForbidden { + return &GetTemplateForbidden{} +} + +/* GetTemplateForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetTemplateForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetTemplateForbidden) Error() string { + return fmt.Sprintf("[GET /templates/{templateIdPath}][%d] getTemplateForbidden %+v", 403, o.Payload) +} +func (o *GetTemplateForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTemplateForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTemplateNotFound creates a GetTemplateNotFound with default headers values +func NewGetTemplateNotFound() *GetTemplateNotFound { + return &GetTemplateNotFound{} +} + +/* GetTemplateNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetTemplateNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetTemplateNotFound) Error() string { + return fmt.Sprintf("[GET /templates/{templateIdPath}][%d] getTemplateNotFound %+v", 404, o.Payload) +} +func (o *GetTemplateNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTemplateNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTemplateUnprocessableEntity creates a GetTemplateUnprocessableEntity with default headers values +func NewGetTemplateUnprocessableEntity() *GetTemplateUnprocessableEntity { + return &GetTemplateUnprocessableEntity{} +} + +/* GetTemplateUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetTemplateUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetTemplateUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /templates/{templateIdPath}][%d] getTemplateUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetTemplateUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTemplateUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTemplateInternalServerError creates a GetTemplateInternalServerError with default headers values +func NewGetTemplateInternalServerError() *GetTemplateInternalServerError { + return &GetTemplateInternalServerError{} +} + +/* GetTemplateInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetTemplateInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetTemplateInternalServerError) Error() string { + return fmt.Sprintf("[GET /templates/{templateIdPath}][%d] getTemplateInternalServerError %+v", 500, o.Payload) +} +func (o *GetTemplateInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTemplateInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/template/get_templates_observable_parameters.go b/api/devops/devops_client/template/get_templates_observable_parameters.go new file mode 100644 index 0000000..20f8ef6 --- /dev/null +++ b/api/devops/devops_client/template/get_templates_observable_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package template + +// 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" +) + +// NewGetTemplatesObservableParams creates a new GetTemplatesObservableParams 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 NewGetTemplatesObservableParams() *GetTemplatesObservableParams { + return &GetTemplatesObservableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTemplatesObservableParamsWithTimeout creates a new GetTemplatesObservableParams object +// with the ability to set a timeout on a request. +func NewGetTemplatesObservableParamsWithTimeout(timeout time.Duration) *GetTemplatesObservableParams { + return &GetTemplatesObservableParams{ + timeout: timeout, + } +} + +// NewGetTemplatesObservableParamsWithContext creates a new GetTemplatesObservableParams object +// with the ability to set a context for a request. +func NewGetTemplatesObservableParamsWithContext(ctx context.Context) *GetTemplatesObservableParams { + return &GetTemplatesObservableParams{ + Context: ctx, + } +} + +// NewGetTemplatesObservableParamsWithHTTPClient creates a new GetTemplatesObservableParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTemplatesObservableParamsWithHTTPClient(client *http.Client) *GetTemplatesObservableParams { + return &GetTemplatesObservableParams{ + HTTPClient: client, + } +} + +/* GetTemplatesObservableParams contains all the parameters to send to the API endpoint + for the get templates observable operation. + + Typically these are written to a http.Request. +*/ +type GetTemplatesObservableParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get templates observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTemplatesObservableParams) WithDefaults() *GetTemplatesObservableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get templates observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTemplatesObservableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get templates observable params +func (o *GetTemplatesObservableParams) WithTimeout(timeout time.Duration) *GetTemplatesObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get templates observable params +func (o *GetTemplatesObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get templates observable params +func (o *GetTemplatesObservableParams) WithContext(ctx context.Context) *GetTemplatesObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get templates observable params +func (o *GetTemplatesObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get templates observable params +func (o *GetTemplatesObservableParams) WithHTTPClient(client *http.Client) *GetTemplatesObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get templates observable params +func (o *GetTemplatesObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTemplatesObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/template/get_templates_observable_responses.go b/api/devops/devops_client/template/get_templates_observable_responses.go new file mode 100644 index 0000000..b282aa8 --- /dev/null +++ b/api/devops/devops_client/template/get_templates_observable_responses.go @@ -0,0 +1,337 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package template + +// 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/telnexus/lib/api/devops/devops_models" +) + +// GetTemplatesObservableReader is a Reader for the GetTemplatesObservable structure. +type GetTemplatesObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTemplatesObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTemplatesObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTemplatesObservableUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetTemplatesObservableForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTemplatesObservableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetTemplatesObservableUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTemplatesObservableInternalServerError() + 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()) + } +} + +// NewGetTemplatesObservableOK creates a GetTemplatesObservableOK with default headers values +func NewGetTemplatesObservableOK() *GetTemplatesObservableOK { + return &GetTemplatesObservableOK{} +} + +/* GetTemplatesObservableOK describes a response with status code 200, with default header values. + +Simple Template record response +*/ +type GetTemplatesObservableOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload []*devops_models.Template +} + +func (o *GetTemplatesObservableOK) Error() string { + return fmt.Sprintf("[GET /templates/observable][%d] getTemplatesObservableOK %+v", 200, o.Payload) +} +func (o *GetTemplatesObservableOK) GetPayload() []*devops_models.Template { + return o.Payload +} + +func (o *GetTemplatesObservableOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTemplatesObservableUnauthorized creates a GetTemplatesObservableUnauthorized with default headers values +func NewGetTemplatesObservableUnauthorized() *GetTemplatesObservableUnauthorized { + return &GetTemplatesObservableUnauthorized{} +} + +/* GetTemplatesObservableUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetTemplatesObservableUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetTemplatesObservableUnauthorized) Error() string { + return fmt.Sprintf("[GET /templates/observable][%d] getTemplatesObservableUnauthorized %+v", 401, o.Payload) +} +func (o *GetTemplatesObservableUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTemplatesObservableUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTemplatesObservableForbidden creates a GetTemplatesObservableForbidden with default headers values +func NewGetTemplatesObservableForbidden() *GetTemplatesObservableForbidden { + return &GetTemplatesObservableForbidden{} +} + +/* GetTemplatesObservableForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetTemplatesObservableForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetTemplatesObservableForbidden) Error() string { + return fmt.Sprintf("[GET /templates/observable][%d] getTemplatesObservableForbidden %+v", 403, o.Payload) +} +func (o *GetTemplatesObservableForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTemplatesObservableForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTemplatesObservableNotFound creates a GetTemplatesObservableNotFound with default headers values +func NewGetTemplatesObservableNotFound() *GetTemplatesObservableNotFound { + return &GetTemplatesObservableNotFound{} +} + +/* GetTemplatesObservableNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetTemplatesObservableNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetTemplatesObservableNotFound) Error() string { + return fmt.Sprintf("[GET /templates/observable][%d] getTemplatesObservableNotFound %+v", 404, o.Payload) +} +func (o *GetTemplatesObservableNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTemplatesObservableNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTemplatesObservableUnprocessableEntity creates a GetTemplatesObservableUnprocessableEntity with default headers values +func NewGetTemplatesObservableUnprocessableEntity() *GetTemplatesObservableUnprocessableEntity { + return &GetTemplatesObservableUnprocessableEntity{} +} + +/* GetTemplatesObservableUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetTemplatesObservableUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetTemplatesObservableUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /templates/observable][%d] getTemplatesObservableUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetTemplatesObservableUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTemplatesObservableUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTemplatesObservableInternalServerError creates a GetTemplatesObservableInternalServerError with default headers values +func NewGetTemplatesObservableInternalServerError() *GetTemplatesObservableInternalServerError { + return &GetTemplatesObservableInternalServerError{} +} + +/* GetTemplatesObservableInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetTemplatesObservableInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetTemplatesObservableInternalServerError) Error() string { + return fmt.Sprintf("[GET /templates/observable][%d] getTemplatesObservableInternalServerError %+v", 500, o.Payload) +} +func (o *GetTemplatesObservableInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTemplatesObservableInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/template/get_templates_parameters.go b/api/devops/devops_client/template/get_templates_parameters.go new file mode 100644 index 0000000..9a638b7 --- /dev/null +++ b/api/devops/devops_client/template/get_templates_parameters.go @@ -0,0 +1,340 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package template + +// 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" +) + +// NewGetTemplatesParams creates a new GetTemplatesParams 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 NewGetTemplatesParams() *GetTemplatesParams { + return &GetTemplatesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTemplatesParamsWithTimeout creates a new GetTemplatesParams object +// with the ability to set a timeout on a request. +func NewGetTemplatesParamsWithTimeout(timeout time.Duration) *GetTemplatesParams { + return &GetTemplatesParams{ + timeout: timeout, + } +} + +// NewGetTemplatesParamsWithContext creates a new GetTemplatesParams object +// with the ability to set a context for a request. +func NewGetTemplatesParamsWithContext(ctx context.Context) *GetTemplatesParams { + return &GetTemplatesParams{ + Context: ctx, + } +} + +// NewGetTemplatesParamsWithHTTPClient creates a new GetTemplatesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTemplatesParamsWithHTTPClient(client *http.Client) *GetTemplatesParams { + return &GetTemplatesParams{ + HTTPClient: client, + } +} + +/* GetTemplatesParams contains all the parameters to send to the API endpoint + for the get templates operation. + + Typically these are written to a http.Request. +*/ +type GetTemplatesParams struct { + + /* Active. + + Retrieve active records only? + */ + Active *bool + + /* IsMaster. + + Is Master Template? + */ + IsMaster *bool + + /* Limit. + + How many objects to return at one time + + Format: int64 + */ + Limit *int64 + + /* ObjectType. + + Object Type Name + */ + ObjectType *string + + /* Offset. + + How many objects to skip? (default 0) + + Format: int64 + */ + Offset *int64 + + /* TemplateID. + + Template ID + */ + TemplateID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get templates params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTemplatesParams) WithDefaults() *GetTemplatesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get templates params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTemplatesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get templates params +func (o *GetTemplatesParams) WithTimeout(timeout time.Duration) *GetTemplatesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get templates params +func (o *GetTemplatesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get templates params +func (o *GetTemplatesParams) WithContext(ctx context.Context) *GetTemplatesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get templates params +func (o *GetTemplatesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get templates params +func (o *GetTemplatesParams) WithHTTPClient(client *http.Client) *GetTemplatesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get templates params +func (o *GetTemplatesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithActive adds the active to the get templates params +func (o *GetTemplatesParams) WithActive(active *bool) *GetTemplatesParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get templates params +func (o *GetTemplatesParams) SetActive(active *bool) { + o.Active = active +} + +// WithIsMaster adds the isMaster to the get templates params +func (o *GetTemplatesParams) WithIsMaster(isMaster *bool) *GetTemplatesParams { + o.SetIsMaster(isMaster) + return o +} + +// SetIsMaster adds the isMaster to the get templates params +func (o *GetTemplatesParams) SetIsMaster(isMaster *bool) { + o.IsMaster = isMaster +} + +// WithLimit adds the limit to the get templates params +func (o *GetTemplatesParams) WithLimit(limit *int64) *GetTemplatesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get templates params +func (o *GetTemplatesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithObjectType adds the objectType to the get templates params +func (o *GetTemplatesParams) WithObjectType(objectType *string) *GetTemplatesParams { + o.SetObjectType(objectType) + return o +} + +// SetObjectType adds the objectType to the get templates params +func (o *GetTemplatesParams) SetObjectType(objectType *string) { + o.ObjectType = objectType +} + +// WithOffset adds the offset to the get templates params +func (o *GetTemplatesParams) WithOffset(offset *int64) *GetTemplatesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get templates params +func (o *GetTemplatesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithTemplateID adds the templateID to the get templates params +func (o *GetTemplatesParams) WithTemplateID(templateID *string) *GetTemplatesParams { + o.SetTemplateID(templateID) + return o +} + +// SetTemplateID adds the templateId to the get templates params +func (o *GetTemplatesParams) SetTemplateID(templateID *string) { + o.TemplateID = templateID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTemplatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Active != nil { + + // query param active + var qrActive bool + + if o.Active != nil { + qrActive = *o.Active + } + qActive := swag.FormatBool(qrActive) + if qActive != "" { + + if err := r.SetQueryParam("active", qActive); err != nil { + return err + } + } + } + + if o.IsMaster != nil { + + // query param isMaster + var qrIsMaster bool + + if o.IsMaster != nil { + qrIsMaster = *o.IsMaster + } + qIsMaster := swag.FormatBool(qrIsMaster) + if qIsMaster != "" { + + if err := r.SetQueryParam("isMaster", qIsMaster); 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.ObjectType != nil { + + // query param objectType + var qrObjectType string + + if o.ObjectType != nil { + qrObjectType = *o.ObjectType + } + qObjectType := qrObjectType + if qObjectType != "" { + + if err := r.SetQueryParam("objectType", qObjectType); 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 o.TemplateID != nil { + + // query param templateId + var qrTemplateID string + + if o.TemplateID != nil { + qrTemplateID = *o.TemplateID + } + qTemplateID := qrTemplateID + if qTemplateID != "" { + + if err := r.SetQueryParam("templateId", qTemplateID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/template/get_templates_responses.go b/api/devops/devops_client/template/get_templates_responses.go new file mode 100644 index 0000000..6700610 --- /dev/null +++ b/api/devops/devops_client/template/get_templates_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package template + +// 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/telnexus/lib/api/devops/devops_models" +) + +// GetTemplatesReader is a Reader for the GetTemplates structure. +type GetTemplatesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTemplatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTemplatesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTemplatesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetTemplatesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTemplatesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetTemplatesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTemplatesInternalServerError() + 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()) + } +} + +// NewGetTemplatesOK creates a GetTemplatesOK with default headers values +func NewGetTemplatesOK() *GetTemplatesOK { + return &GetTemplatesOK{} +} + +/* GetTemplatesOK describes a response with status code 200, with default header values. + +Telnexus Response with Template objects +*/ +type GetTemplatesOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.TemplateResponse +} + +func (o *GetTemplatesOK) Error() string { + return fmt.Sprintf("[GET /templates][%d] getTemplatesOK %+v", 200, o.Payload) +} +func (o *GetTemplatesOK) GetPayload() *devops_models.TemplateResponse { + return o.Payload +} + +func (o *GetTemplatesOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.TemplateResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTemplatesUnauthorized creates a GetTemplatesUnauthorized with default headers values +func NewGetTemplatesUnauthorized() *GetTemplatesUnauthorized { + return &GetTemplatesUnauthorized{} +} + +/* GetTemplatesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetTemplatesUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetTemplatesUnauthorized) Error() string { + return fmt.Sprintf("[GET /templates][%d] getTemplatesUnauthorized %+v", 401, o.Payload) +} +func (o *GetTemplatesUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTemplatesUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTemplatesForbidden creates a GetTemplatesForbidden with default headers values +func NewGetTemplatesForbidden() *GetTemplatesForbidden { + return &GetTemplatesForbidden{} +} + +/* GetTemplatesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetTemplatesForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetTemplatesForbidden) Error() string { + return fmt.Sprintf("[GET /templates][%d] getTemplatesForbidden %+v", 403, o.Payload) +} +func (o *GetTemplatesForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTemplatesForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTemplatesNotFound creates a GetTemplatesNotFound with default headers values +func NewGetTemplatesNotFound() *GetTemplatesNotFound { + return &GetTemplatesNotFound{} +} + +/* GetTemplatesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetTemplatesNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetTemplatesNotFound) Error() string { + return fmt.Sprintf("[GET /templates][%d] getTemplatesNotFound %+v", 404, o.Payload) +} +func (o *GetTemplatesNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTemplatesNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTemplatesUnprocessableEntity creates a GetTemplatesUnprocessableEntity with default headers values +func NewGetTemplatesUnprocessableEntity() *GetTemplatesUnprocessableEntity { + return &GetTemplatesUnprocessableEntity{} +} + +/* GetTemplatesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetTemplatesUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetTemplatesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /templates][%d] getTemplatesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetTemplatesUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTemplatesUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTemplatesInternalServerError creates a GetTemplatesInternalServerError with default headers values +func NewGetTemplatesInternalServerError() *GetTemplatesInternalServerError { + return &GetTemplatesInternalServerError{} +} + +/* GetTemplatesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetTemplatesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetTemplatesInternalServerError) Error() string { + return fmt.Sprintf("[GET /templates][%d] getTemplatesInternalServerError %+v", 500, o.Payload) +} +func (o *GetTemplatesInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTemplatesInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/template/post_templates_parameters.go b/api/devops/devops_client/template/post_templates_parameters.go new file mode 100644 index 0000000..23263d1 --- /dev/null +++ b/api/devops/devops_client/template/post_templates_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package template + +// 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/telnexus/lib/api/devops/devops_models" +) + +// NewPostTemplatesParams creates a new PostTemplatesParams 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 NewPostTemplatesParams() *PostTemplatesParams { + return &PostTemplatesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostTemplatesParamsWithTimeout creates a new PostTemplatesParams object +// with the ability to set a timeout on a request. +func NewPostTemplatesParamsWithTimeout(timeout time.Duration) *PostTemplatesParams { + return &PostTemplatesParams{ + timeout: timeout, + } +} + +// NewPostTemplatesParamsWithContext creates a new PostTemplatesParams object +// with the ability to set a context for a request. +func NewPostTemplatesParamsWithContext(ctx context.Context) *PostTemplatesParams { + return &PostTemplatesParams{ + Context: ctx, + } +} + +// NewPostTemplatesParamsWithHTTPClient creates a new PostTemplatesParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostTemplatesParamsWithHTTPClient(client *http.Client) *PostTemplatesParams { + return &PostTemplatesParams{ + HTTPClient: client, + } +} + +/* PostTemplatesParams contains all the parameters to send to the API endpoint + for the post templates operation. + + Typically these are written to a http.Request. +*/ +type PostTemplatesParams struct { + + /* TemplateRequest. + + An array of Template records + */ + TemplateRequest *devops_models.TemplateRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post templates params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostTemplatesParams) WithDefaults() *PostTemplatesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post templates params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostTemplatesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post templates params +func (o *PostTemplatesParams) WithTimeout(timeout time.Duration) *PostTemplatesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post templates params +func (o *PostTemplatesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post templates params +func (o *PostTemplatesParams) WithContext(ctx context.Context) *PostTemplatesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post templates params +func (o *PostTemplatesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post templates params +func (o *PostTemplatesParams) WithHTTPClient(client *http.Client) *PostTemplatesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post templates params +func (o *PostTemplatesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTemplateRequest adds the templateRequest to the post templates params +func (o *PostTemplatesParams) WithTemplateRequest(templateRequest *devops_models.TemplateRequest) *PostTemplatesParams { + o.SetTemplateRequest(templateRequest) + return o +} + +// SetTemplateRequest adds the templateRequest to the post templates params +func (o *PostTemplatesParams) SetTemplateRequest(templateRequest *devops_models.TemplateRequest) { + o.TemplateRequest = templateRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostTemplatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.TemplateRequest != nil { + if err := r.SetBodyParam(o.TemplateRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/template/post_templates_responses.go b/api/devops/devops_client/template/post_templates_responses.go new file mode 100644 index 0000000..374c1d4 --- /dev/null +++ b/api/devops/devops_client/template/post_templates_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package template + +// 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/telnexus/lib/api/devops/devops_models" +) + +// PostTemplatesReader is a Reader for the PostTemplates structure. +type PostTemplatesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostTemplatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostTemplatesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostTemplatesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostTemplatesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostTemplatesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostTemplatesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostTemplatesInternalServerError() + 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()) + } +} + +// NewPostTemplatesOK creates a PostTemplatesOK with default headers values +func NewPostTemplatesOK() *PostTemplatesOK { + return &PostTemplatesOK{} +} + +/* PostTemplatesOK describes a response with status code 200, with default header values. + +Telnexus Response with Template objects +*/ +type PostTemplatesOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.TemplateResponse +} + +func (o *PostTemplatesOK) Error() string { + return fmt.Sprintf("[POST /templates][%d] postTemplatesOK %+v", 200, o.Payload) +} +func (o *PostTemplatesOK) GetPayload() *devops_models.TemplateResponse { + return o.Payload +} + +func (o *PostTemplatesOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.TemplateResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTemplatesUnauthorized creates a PostTemplatesUnauthorized with default headers values +func NewPostTemplatesUnauthorized() *PostTemplatesUnauthorized { + return &PostTemplatesUnauthorized{} +} + +/* PostTemplatesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostTemplatesUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PostTemplatesUnauthorized) Error() string { + return fmt.Sprintf("[POST /templates][%d] postTemplatesUnauthorized %+v", 401, o.Payload) +} +func (o *PostTemplatesUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostTemplatesUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTemplatesForbidden creates a PostTemplatesForbidden with default headers values +func NewPostTemplatesForbidden() *PostTemplatesForbidden { + return &PostTemplatesForbidden{} +} + +/* PostTemplatesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostTemplatesForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostTemplatesForbidden) Error() string { + return fmt.Sprintf("[POST /templates][%d] postTemplatesForbidden %+v", 403, o.Payload) +} +func (o *PostTemplatesForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostTemplatesForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTemplatesNotFound creates a PostTemplatesNotFound with default headers values +func NewPostTemplatesNotFound() *PostTemplatesNotFound { + return &PostTemplatesNotFound{} +} + +/* PostTemplatesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostTemplatesNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostTemplatesNotFound) Error() string { + return fmt.Sprintf("[POST /templates][%d] postTemplatesNotFound %+v", 404, o.Payload) +} +func (o *PostTemplatesNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostTemplatesNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTemplatesUnprocessableEntity creates a PostTemplatesUnprocessableEntity with default headers values +func NewPostTemplatesUnprocessableEntity() *PostTemplatesUnprocessableEntity { + return &PostTemplatesUnprocessableEntity{} +} + +/* PostTemplatesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostTemplatesUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PostTemplatesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /templates][%d] postTemplatesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PostTemplatesUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostTemplatesUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTemplatesInternalServerError creates a PostTemplatesInternalServerError with default headers values +func NewPostTemplatesInternalServerError() *PostTemplatesInternalServerError { + return &PostTemplatesInternalServerError{} +} + +/* PostTemplatesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostTemplatesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostTemplatesInternalServerError) Error() string { + return fmt.Sprintf("[POST /templates][%d] postTemplatesInternalServerError %+v", 500, o.Payload) +} +func (o *PostTemplatesInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostTemplatesInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/template/template_client.go b/api/devops/devops_client/template/template_client.go new file mode 100644 index 0000000..c72d02b --- /dev/null +++ b/api/devops/devops_client/template/template_client.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package template + +// 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 template API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for template 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 { + GetTemplate(params *GetTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTemplateOK, error) + + GetTemplates(params *GetTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTemplatesOK, error) + + GetTemplatesObservable(params *GetTemplatesObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTemplatesObservableOK, error) + + PostTemplates(params *PostTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTemplatesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetTemplate gets a single template object + + Return a single Template object from datastore as a Singleton +*/ +func (a *Client) GetTemplate(params *GetTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTemplateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTemplateParams() + } + op := &runtime.ClientOperation{ + ID: "getTemplate", + Method: "GET", + PathPattern: "/templates/{templateIdPath}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTemplateReader{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.(*GetTemplateOK) + 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 getTemplate: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetTemplates gets a list templates + + Return a list of Templates from the datastore +*/ +func (a *Client) GetTemplates(params *GetTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTemplatesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTemplatesParams() + } + op := &runtime.ClientOperation{ + ID: "getTemplates", + Method: "GET", + PathPattern: "/templates", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTemplatesReader{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.(*GetTemplatesOK) + 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 getTemplates: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetTemplatesObservable gets templates in an observable array + + Returns a Template retrieval in a observable array +*/ +func (a *Client) GetTemplatesObservable(params *GetTemplatesObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTemplatesObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTemplatesObservableParams() + } + op := &runtime.ClientOperation{ + ID: "getTemplatesObservable", + Method: "GET", + PathPattern: "/templates/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTemplatesObservableReader{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.(*GetTemplatesObservableOK) + 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 getTemplatesObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostTemplates creates new templates + + Create new Templates +*/ +func (a *Client) PostTemplates(params *PostTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTemplatesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostTemplatesParams() + } + op := &runtime.ClientOperation{ + ID: "postTemplates", + Method: "POST", + PathPattern: "/templates", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostTemplatesReader{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.(*PostTemplatesOK) + 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 postTemplates: 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 +} diff --git a/api/devops/devops_client/tenant/get_tenant_parameters.go b/api/devops/devops_client/tenant/get_tenant_parameters.go new file mode 100644 index 0000000..20dc214 --- /dev/null +++ b/api/devops/devops_client/tenant/get_tenant_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tenant + +// 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" +) + +// NewGetTenantParams creates a new GetTenantParams 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 NewGetTenantParams() *GetTenantParams { + return &GetTenantParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTenantParamsWithTimeout creates a new GetTenantParams object +// with the ability to set a timeout on a request. +func NewGetTenantParamsWithTimeout(timeout time.Duration) *GetTenantParams { + return &GetTenantParams{ + timeout: timeout, + } +} + +// NewGetTenantParamsWithContext creates a new GetTenantParams object +// with the ability to set a context for a request. +func NewGetTenantParamsWithContext(ctx context.Context) *GetTenantParams { + return &GetTenantParams{ + Context: ctx, + } +} + +// NewGetTenantParamsWithHTTPClient creates a new GetTenantParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTenantParamsWithHTTPClient(client *http.Client) *GetTenantParams { + return &GetTenantParams{ + HTTPClient: client, + } +} + +/* GetTenantParams contains all the parameters to send to the API endpoint + for the get tenant operation. + + Typically these are written to a http.Request. +*/ +type GetTenantParams struct { + + /* TenantIDPath. + + Telnexus Record Id of a Tenant + */ + TenantIDPath string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get tenant params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTenantParams) WithDefaults() *GetTenantParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get tenant params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTenantParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get tenant params +func (o *GetTenantParams) WithTimeout(timeout time.Duration) *GetTenantParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tenant params +func (o *GetTenantParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tenant params +func (o *GetTenantParams) WithContext(ctx context.Context) *GetTenantParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tenant params +func (o *GetTenantParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tenant params +func (o *GetTenantParams) WithHTTPClient(client *http.Client) *GetTenantParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tenant params +func (o *GetTenantParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTenantIDPath adds the tenantIDPath to the get tenant params +func (o *GetTenantParams) WithTenantIDPath(tenantIDPath string) *GetTenantParams { + o.SetTenantIDPath(tenantIDPath) + return o +} + +// SetTenantIDPath adds the tenantIdPath to the get tenant params +func (o *GetTenantParams) SetTenantIDPath(tenantIDPath string) { + o.TenantIDPath = tenantIDPath +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTenantParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param tenantIdPath + if err := r.SetPathParam("tenantIdPath", o.TenantIDPath); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/tenant/get_tenant_responses.go b/api/devops/devops_client/tenant/get_tenant_responses.go new file mode 100644 index 0000000..c695ca0 --- /dev/null +++ b/api/devops/devops_client/tenant/get_tenant_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tenant + +// 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/telnexus/lib/api/devops/devops_models" +) + +// GetTenantReader is a Reader for the GetTenant structure. +type GetTenantReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTenantReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTenantOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTenantUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetTenantForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTenantNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetTenantUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTenantInternalServerError() + 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()) + } +} + +// NewGetTenantOK creates a GetTenantOK with default headers values +func NewGetTenantOK() *GetTenantOK { + return &GetTenantOK{} +} + +/* GetTenantOK describes a response with status code 200, with default header values. + +Single Tenant record response +*/ +type GetTenantOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Tenant +} + +func (o *GetTenantOK) Error() string { + return fmt.Sprintf("[GET /tenants/{tenantIdPath}][%d] getTenantOK %+v", 200, o.Payload) +} +func (o *GetTenantOK) GetPayload() *devops_models.Tenant { + return o.Payload +} + +func (o *GetTenantOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Tenant) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTenantUnauthorized creates a GetTenantUnauthorized with default headers values +func NewGetTenantUnauthorized() *GetTenantUnauthorized { + return &GetTenantUnauthorized{} +} + +/* GetTenantUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetTenantUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetTenantUnauthorized) Error() string { + return fmt.Sprintf("[GET /tenants/{tenantIdPath}][%d] getTenantUnauthorized %+v", 401, o.Payload) +} +func (o *GetTenantUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTenantUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTenantForbidden creates a GetTenantForbidden with default headers values +func NewGetTenantForbidden() *GetTenantForbidden { + return &GetTenantForbidden{} +} + +/* GetTenantForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetTenantForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetTenantForbidden) Error() string { + return fmt.Sprintf("[GET /tenants/{tenantIdPath}][%d] getTenantForbidden %+v", 403, o.Payload) +} +func (o *GetTenantForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTenantForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTenantNotFound creates a GetTenantNotFound with default headers values +func NewGetTenantNotFound() *GetTenantNotFound { + return &GetTenantNotFound{} +} + +/* GetTenantNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetTenantNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetTenantNotFound) Error() string { + return fmt.Sprintf("[GET /tenants/{tenantIdPath}][%d] getTenantNotFound %+v", 404, o.Payload) +} +func (o *GetTenantNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTenantNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTenantUnprocessableEntity creates a GetTenantUnprocessableEntity with default headers values +func NewGetTenantUnprocessableEntity() *GetTenantUnprocessableEntity { + return &GetTenantUnprocessableEntity{} +} + +/* GetTenantUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetTenantUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetTenantUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /tenants/{tenantIdPath}][%d] getTenantUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetTenantUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTenantUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTenantInternalServerError creates a GetTenantInternalServerError with default headers values +func NewGetTenantInternalServerError() *GetTenantInternalServerError { + return &GetTenantInternalServerError{} +} + +/* GetTenantInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetTenantInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetTenantInternalServerError) Error() string { + return fmt.Sprintf("[GET /tenants/{tenantIdPath}][%d] getTenantInternalServerError %+v", 500, o.Payload) +} +func (o *GetTenantInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTenantInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/tenant/get_tenants_observable_parameters.go b/api/devops/devops_client/tenant/get_tenants_observable_parameters.go new file mode 100644 index 0000000..94e855d --- /dev/null +++ b/api/devops/devops_client/tenant/get_tenants_observable_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tenant + +// 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" +) + +// NewGetTenantsObservableParams creates a new GetTenantsObservableParams 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 NewGetTenantsObservableParams() *GetTenantsObservableParams { + return &GetTenantsObservableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTenantsObservableParamsWithTimeout creates a new GetTenantsObservableParams object +// with the ability to set a timeout on a request. +func NewGetTenantsObservableParamsWithTimeout(timeout time.Duration) *GetTenantsObservableParams { + return &GetTenantsObservableParams{ + timeout: timeout, + } +} + +// NewGetTenantsObservableParamsWithContext creates a new GetTenantsObservableParams object +// with the ability to set a context for a request. +func NewGetTenantsObservableParamsWithContext(ctx context.Context) *GetTenantsObservableParams { + return &GetTenantsObservableParams{ + Context: ctx, + } +} + +// NewGetTenantsObservableParamsWithHTTPClient creates a new GetTenantsObservableParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTenantsObservableParamsWithHTTPClient(client *http.Client) *GetTenantsObservableParams { + return &GetTenantsObservableParams{ + HTTPClient: client, + } +} + +/* GetTenantsObservableParams contains all the parameters to send to the API endpoint + for the get tenants observable operation. + + Typically these are written to a http.Request. +*/ +type GetTenantsObservableParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get tenants observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTenantsObservableParams) WithDefaults() *GetTenantsObservableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get tenants observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTenantsObservableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get tenants observable params +func (o *GetTenantsObservableParams) WithTimeout(timeout time.Duration) *GetTenantsObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tenants observable params +func (o *GetTenantsObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tenants observable params +func (o *GetTenantsObservableParams) WithContext(ctx context.Context) *GetTenantsObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tenants observable params +func (o *GetTenantsObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tenants observable params +func (o *GetTenantsObservableParams) WithHTTPClient(client *http.Client) *GetTenantsObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tenants observable params +func (o *GetTenantsObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTenantsObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/tenant/get_tenants_observable_responses.go b/api/devops/devops_client/tenant/get_tenants_observable_responses.go new file mode 100644 index 0000000..8c75d36 --- /dev/null +++ b/api/devops/devops_client/tenant/get_tenants_observable_responses.go @@ -0,0 +1,337 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tenant + +// 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/telnexus/lib/api/devops/devops_models" +) + +// GetTenantsObservableReader is a Reader for the GetTenantsObservable structure. +type GetTenantsObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTenantsObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTenantsObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTenantsObservableUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetTenantsObservableForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTenantsObservableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetTenantsObservableUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTenantsObservableInternalServerError() + 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()) + } +} + +// NewGetTenantsObservableOK creates a GetTenantsObservableOK with default headers values +func NewGetTenantsObservableOK() *GetTenantsObservableOK { + return &GetTenantsObservableOK{} +} + +/* GetTenantsObservableOK describes a response with status code 200, with default header values. + +Single Tenant record response +*/ +type GetTenantsObservableOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload []*devops_models.Tenant +} + +func (o *GetTenantsObservableOK) Error() string { + return fmt.Sprintf("[GET /tenants/observable][%d] getTenantsObservableOK %+v", 200, o.Payload) +} +func (o *GetTenantsObservableOK) GetPayload() []*devops_models.Tenant { + return o.Payload +} + +func (o *GetTenantsObservableOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTenantsObservableUnauthorized creates a GetTenantsObservableUnauthorized with default headers values +func NewGetTenantsObservableUnauthorized() *GetTenantsObservableUnauthorized { + return &GetTenantsObservableUnauthorized{} +} + +/* GetTenantsObservableUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetTenantsObservableUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetTenantsObservableUnauthorized) Error() string { + return fmt.Sprintf("[GET /tenants/observable][%d] getTenantsObservableUnauthorized %+v", 401, o.Payload) +} +func (o *GetTenantsObservableUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTenantsObservableUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTenantsObservableForbidden creates a GetTenantsObservableForbidden with default headers values +func NewGetTenantsObservableForbidden() *GetTenantsObservableForbidden { + return &GetTenantsObservableForbidden{} +} + +/* GetTenantsObservableForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetTenantsObservableForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetTenantsObservableForbidden) Error() string { + return fmt.Sprintf("[GET /tenants/observable][%d] getTenantsObservableForbidden %+v", 403, o.Payload) +} +func (o *GetTenantsObservableForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTenantsObservableForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTenantsObservableNotFound creates a GetTenantsObservableNotFound with default headers values +func NewGetTenantsObservableNotFound() *GetTenantsObservableNotFound { + return &GetTenantsObservableNotFound{} +} + +/* GetTenantsObservableNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetTenantsObservableNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetTenantsObservableNotFound) Error() string { + return fmt.Sprintf("[GET /tenants/observable][%d] getTenantsObservableNotFound %+v", 404, o.Payload) +} +func (o *GetTenantsObservableNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTenantsObservableNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTenantsObservableUnprocessableEntity creates a GetTenantsObservableUnprocessableEntity with default headers values +func NewGetTenantsObservableUnprocessableEntity() *GetTenantsObservableUnprocessableEntity { + return &GetTenantsObservableUnprocessableEntity{} +} + +/* GetTenantsObservableUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetTenantsObservableUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetTenantsObservableUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /tenants/observable][%d] getTenantsObservableUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetTenantsObservableUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTenantsObservableUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTenantsObservableInternalServerError creates a GetTenantsObservableInternalServerError with default headers values +func NewGetTenantsObservableInternalServerError() *GetTenantsObservableInternalServerError { + return &GetTenantsObservableInternalServerError{} +} + +/* GetTenantsObservableInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetTenantsObservableInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetTenantsObservableInternalServerError) Error() string { + return fmt.Sprintf("[GET /tenants/observable][%d] getTenantsObservableInternalServerError %+v", 500, o.Payload) +} +func (o *GetTenantsObservableInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTenantsObservableInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/tenant/get_tenants_parameters.go b/api/devops/devops_client/tenant/get_tenants_parameters.go new file mode 100644 index 0000000..984ba58 --- /dev/null +++ b/api/devops/devops_client/tenant/get_tenants_parameters.go @@ -0,0 +1,306 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tenant + +// 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" +) + +// NewGetTenantsParams creates a new GetTenantsParams 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 NewGetTenantsParams() *GetTenantsParams { + return &GetTenantsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTenantsParamsWithTimeout creates a new GetTenantsParams object +// with the ability to set a timeout on a request. +func NewGetTenantsParamsWithTimeout(timeout time.Duration) *GetTenantsParams { + return &GetTenantsParams{ + timeout: timeout, + } +} + +// NewGetTenantsParamsWithContext creates a new GetTenantsParams object +// with the ability to set a context for a request. +func NewGetTenantsParamsWithContext(ctx context.Context) *GetTenantsParams { + return &GetTenantsParams{ + Context: ctx, + } +} + +// NewGetTenantsParamsWithHTTPClient creates a new GetTenantsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTenantsParamsWithHTTPClient(client *http.Client) *GetTenantsParams { + return &GetTenantsParams{ + HTTPClient: client, + } +} + +/* GetTenantsParams contains all the parameters to send to the API endpoint + for the get tenants operation. + + Typically these are written to a http.Request. +*/ +type GetTenantsParams struct { + + /* TelnexusAccount. + + Telnexus Account of a Tenant + */ + TelnexusAccount *string + + /* CompanyID. + + Telnexus Record Id of a Company + */ + CompanyID *string + + /* Limit. + + How many objects to return at one time + + Format: int64 + */ + Limit *int64 + + /* Offset. + + How many objects to skip? (default 0) + + Format: int64 + */ + Offset *int64 + + /* TenantID. + + Telnexus Record Id of a Tenant + */ + TenantID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get tenants params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTenantsParams) WithDefaults() *GetTenantsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get tenants params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTenantsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get tenants params +func (o *GetTenantsParams) WithTimeout(timeout time.Duration) *GetTenantsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tenants params +func (o *GetTenantsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tenants params +func (o *GetTenantsParams) WithContext(ctx context.Context) *GetTenantsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tenants params +func (o *GetTenantsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tenants params +func (o *GetTenantsParams) WithHTTPClient(client *http.Client) *GetTenantsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tenants params +func (o *GetTenantsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTelnexusAccount adds the telnexusAccount to the get tenants params +func (o *GetTenantsParams) WithTelnexusAccount(telnexusAccount *string) *GetTenantsParams { + o.SetTelnexusAccount(telnexusAccount) + return o +} + +// SetTelnexusAccount adds the telnexusAccount to the get tenants params +func (o *GetTenantsParams) SetTelnexusAccount(telnexusAccount *string) { + o.TelnexusAccount = telnexusAccount +} + +// WithCompanyID adds the companyID to the get tenants params +func (o *GetTenantsParams) WithCompanyID(companyID *string) *GetTenantsParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get tenants params +func (o *GetTenantsParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WithLimit adds the limit to the get tenants params +func (o *GetTenantsParams) WithLimit(limit *int64) *GetTenantsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get tenants params +func (o *GetTenantsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get tenants params +func (o *GetTenantsParams) WithOffset(offset *int64) *GetTenantsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get tenants params +func (o *GetTenantsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithTenantID adds the tenantID to the get tenants params +func (o *GetTenantsParams) WithTenantID(tenantID *string) *GetTenantsParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the get tenants params +func (o *GetTenantsParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTenantsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.TelnexusAccount != nil { + + // query param TelnexusAccount + var qrTelnexusAccount string + + if o.TelnexusAccount != nil { + qrTelnexusAccount = *o.TelnexusAccount + } + qTelnexusAccount := qrTelnexusAccount + if qTelnexusAccount != "" { + + if err := r.SetQueryParam("TelnexusAccount", qTelnexusAccount); err != nil { + return err + } + } + } + + if o.CompanyID != nil { + + // query param companyId + var qrCompanyID string + + if o.CompanyID != nil { + qrCompanyID = *o.CompanyID + } + qCompanyID := qrCompanyID + if qCompanyID != "" { + + if err := r.SetQueryParam("companyId", qCompanyID); 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 o.TenantID != nil { + + // query param tenantId + var qrTenantID string + + if o.TenantID != nil { + qrTenantID = *o.TenantID + } + qTenantID := qrTenantID + if qTenantID != "" { + + if err := r.SetQueryParam("tenantId", qTenantID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/tenant/get_tenants_responses.go b/api/devops/devops_client/tenant/get_tenants_responses.go new file mode 100644 index 0000000..2ec6bf3 --- /dev/null +++ b/api/devops/devops_client/tenant/get_tenants_responses.go @@ -0,0 +1,331 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tenant + +// 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/telnexus/lib/api/devops/devops_models" +) + +// GetTenantsReader is a Reader for the GetTenants structure. +type GetTenantsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTenantsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTenantsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTenantsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetTenantsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTenantsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetTenantsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTenantsInternalServerError() + 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()) + } +} + +// NewGetTenantsOK creates a GetTenantsOK with default headers values +func NewGetTenantsOK() *GetTenantsOK { + return &GetTenantsOK{} +} + +/* GetTenantsOK describes a response with status code 200, with default header values. + +Telnexus Response with Tenant objects +*/ +type GetTenantsOK struct { + AccessControlAllowOrigin string + + Payload *devops_models.TenantResponse +} + +func (o *GetTenantsOK) Error() string { + return fmt.Sprintf("[GET /tenants][%d] getTenantsOK %+v", 200, o.Payload) +} +func (o *GetTenantsOK) GetPayload() *devops_models.TenantResponse { + return o.Payload +} + +func (o *GetTenantsOK) 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(devops_models.TenantResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTenantsUnauthorized creates a GetTenantsUnauthorized with default headers values +func NewGetTenantsUnauthorized() *GetTenantsUnauthorized { + return &GetTenantsUnauthorized{} +} + +/* GetTenantsUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetTenantsUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetTenantsUnauthorized) Error() string { + return fmt.Sprintf("[GET /tenants][%d] getTenantsUnauthorized %+v", 401, o.Payload) +} +func (o *GetTenantsUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTenantsUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTenantsForbidden creates a GetTenantsForbidden with default headers values +func NewGetTenantsForbidden() *GetTenantsForbidden { + return &GetTenantsForbidden{} +} + +/* GetTenantsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetTenantsForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetTenantsForbidden) Error() string { + return fmt.Sprintf("[GET /tenants][%d] getTenantsForbidden %+v", 403, o.Payload) +} +func (o *GetTenantsForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTenantsForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTenantsNotFound creates a GetTenantsNotFound with default headers values +func NewGetTenantsNotFound() *GetTenantsNotFound { + return &GetTenantsNotFound{} +} + +/* GetTenantsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetTenantsNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetTenantsNotFound) Error() string { + return fmt.Sprintf("[GET /tenants][%d] getTenantsNotFound %+v", 404, o.Payload) +} +func (o *GetTenantsNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTenantsNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTenantsUnprocessableEntity creates a GetTenantsUnprocessableEntity with default headers values +func NewGetTenantsUnprocessableEntity() *GetTenantsUnprocessableEntity { + return &GetTenantsUnprocessableEntity{} +} + +/* GetTenantsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetTenantsUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetTenantsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /tenants][%d] getTenantsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetTenantsUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTenantsUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTenantsInternalServerError creates a GetTenantsInternalServerError with default headers values +func NewGetTenantsInternalServerError() *GetTenantsInternalServerError { + return &GetTenantsInternalServerError{} +} + +/* GetTenantsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetTenantsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetTenantsInternalServerError) Error() string { + return fmt.Sprintf("[GET /tenants][%d] getTenantsInternalServerError %+v", 500, o.Payload) +} +func (o *GetTenantsInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetTenantsInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/tenant/post_tenants_parameters.go b/api/devops/devops_client/tenant/post_tenants_parameters.go new file mode 100644 index 0000000..d7fa3a7 --- /dev/null +++ b/api/devops/devops_client/tenant/post_tenants_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tenant + +// 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/telnexus/lib/api/devops/devops_models" +) + +// NewPostTenantsParams creates a new PostTenantsParams 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 NewPostTenantsParams() *PostTenantsParams { + return &PostTenantsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostTenantsParamsWithTimeout creates a new PostTenantsParams object +// with the ability to set a timeout on a request. +func NewPostTenantsParamsWithTimeout(timeout time.Duration) *PostTenantsParams { + return &PostTenantsParams{ + timeout: timeout, + } +} + +// NewPostTenantsParamsWithContext creates a new PostTenantsParams object +// with the ability to set a context for a request. +func NewPostTenantsParamsWithContext(ctx context.Context) *PostTenantsParams { + return &PostTenantsParams{ + Context: ctx, + } +} + +// NewPostTenantsParamsWithHTTPClient creates a new PostTenantsParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostTenantsParamsWithHTTPClient(client *http.Client) *PostTenantsParams { + return &PostTenantsParams{ + HTTPClient: client, + } +} + +/* PostTenantsParams contains all the parameters to send to the API endpoint + for the post tenants operation. + + Typically these are written to a http.Request. +*/ +type PostTenantsParams struct { + + /* TenantRequest. + + An array of Tenant records + */ + TenantRequest *devops_models.TenantRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post tenants params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostTenantsParams) WithDefaults() *PostTenantsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post tenants params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostTenantsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post tenants params +func (o *PostTenantsParams) WithTimeout(timeout time.Duration) *PostTenantsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post tenants params +func (o *PostTenantsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post tenants params +func (o *PostTenantsParams) WithContext(ctx context.Context) *PostTenantsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post tenants params +func (o *PostTenantsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post tenants params +func (o *PostTenantsParams) WithHTTPClient(client *http.Client) *PostTenantsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post tenants params +func (o *PostTenantsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTenantRequest adds the tenantRequest to the post tenants params +func (o *PostTenantsParams) WithTenantRequest(tenantRequest *devops_models.TenantRequest) *PostTenantsParams { + o.SetTenantRequest(tenantRequest) + return o +} + +// SetTenantRequest adds the tenantRequest to the post tenants params +func (o *PostTenantsParams) SetTenantRequest(tenantRequest *devops_models.TenantRequest) { + o.TenantRequest = tenantRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostTenantsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.TenantRequest != nil { + if err := r.SetBodyParam(o.TenantRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/tenant/post_tenants_responses.go b/api/devops/devops_client/tenant/post_tenants_responses.go new file mode 100644 index 0000000..4a1eb00 --- /dev/null +++ b/api/devops/devops_client/tenant/post_tenants_responses.go @@ -0,0 +1,331 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tenant + +// 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/telnexus/lib/api/devops/devops_models" +) + +// PostTenantsReader is a Reader for the PostTenants structure. +type PostTenantsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostTenantsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostTenantsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostTenantsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostTenantsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostTenantsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostTenantsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostTenantsInternalServerError() + 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()) + } +} + +// NewPostTenantsOK creates a PostTenantsOK with default headers values +func NewPostTenantsOK() *PostTenantsOK { + return &PostTenantsOK{} +} + +/* PostTenantsOK describes a response with status code 200, with default header values. + +Telnexus Response with Tenant objects +*/ +type PostTenantsOK struct { + AccessControlAllowOrigin string + + Payload *devops_models.TenantResponse +} + +func (o *PostTenantsOK) Error() string { + return fmt.Sprintf("[POST /tenants][%d] postTenantsOK %+v", 200, o.Payload) +} +func (o *PostTenantsOK) GetPayload() *devops_models.TenantResponse { + return o.Payload +} + +func (o *PostTenantsOK) 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(devops_models.TenantResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTenantsUnauthorized creates a PostTenantsUnauthorized with default headers values +func NewPostTenantsUnauthorized() *PostTenantsUnauthorized { + return &PostTenantsUnauthorized{} +} + +/* PostTenantsUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostTenantsUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PostTenantsUnauthorized) Error() string { + return fmt.Sprintf("[POST /tenants][%d] postTenantsUnauthorized %+v", 401, o.Payload) +} +func (o *PostTenantsUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostTenantsUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTenantsForbidden creates a PostTenantsForbidden with default headers values +func NewPostTenantsForbidden() *PostTenantsForbidden { + return &PostTenantsForbidden{} +} + +/* PostTenantsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostTenantsForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostTenantsForbidden) Error() string { + return fmt.Sprintf("[POST /tenants][%d] postTenantsForbidden %+v", 403, o.Payload) +} +func (o *PostTenantsForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostTenantsForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTenantsNotFound creates a PostTenantsNotFound with default headers values +func NewPostTenantsNotFound() *PostTenantsNotFound { + return &PostTenantsNotFound{} +} + +/* PostTenantsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostTenantsNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostTenantsNotFound) Error() string { + return fmt.Sprintf("[POST /tenants][%d] postTenantsNotFound %+v", 404, o.Payload) +} +func (o *PostTenantsNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostTenantsNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTenantsUnprocessableEntity creates a PostTenantsUnprocessableEntity with default headers values +func NewPostTenantsUnprocessableEntity() *PostTenantsUnprocessableEntity { + return &PostTenantsUnprocessableEntity{} +} + +/* PostTenantsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostTenantsUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PostTenantsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /tenants][%d] postTenantsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PostTenantsUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostTenantsUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTenantsInternalServerError creates a PostTenantsInternalServerError with default headers values +func NewPostTenantsInternalServerError() *PostTenantsInternalServerError { + return &PostTenantsInternalServerError{} +} + +/* PostTenantsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostTenantsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostTenantsInternalServerError) Error() string { + return fmt.Sprintf("[POST /tenants][%d] postTenantsInternalServerError %+v", 500, o.Payload) +} +func (o *PostTenantsInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostTenantsInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/tenant/put_tenants_parameters.go b/api/devops/devops_client/tenant/put_tenants_parameters.go new file mode 100644 index 0000000..ffafaa9 --- /dev/null +++ b/api/devops/devops_client/tenant/put_tenants_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tenant + +// 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/telnexus/lib/api/devops/devops_models" +) + +// NewPutTenantsParams creates a new PutTenantsParams 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 NewPutTenantsParams() *PutTenantsParams { + return &PutTenantsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPutTenantsParamsWithTimeout creates a new PutTenantsParams object +// with the ability to set a timeout on a request. +func NewPutTenantsParamsWithTimeout(timeout time.Duration) *PutTenantsParams { + return &PutTenantsParams{ + timeout: timeout, + } +} + +// NewPutTenantsParamsWithContext creates a new PutTenantsParams object +// with the ability to set a context for a request. +func NewPutTenantsParamsWithContext(ctx context.Context) *PutTenantsParams { + return &PutTenantsParams{ + Context: ctx, + } +} + +// NewPutTenantsParamsWithHTTPClient creates a new PutTenantsParams object +// with the ability to set a custom HTTPClient for a request. +func NewPutTenantsParamsWithHTTPClient(client *http.Client) *PutTenantsParams { + return &PutTenantsParams{ + HTTPClient: client, + } +} + +/* PutTenantsParams contains all the parameters to send to the API endpoint + for the put tenants operation. + + Typically these are written to a http.Request. +*/ +type PutTenantsParams struct { + + /* TenantRequest. + + An array of Tenant records + */ + TenantRequest *devops_models.TenantRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put tenants params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutTenantsParams) WithDefaults() *PutTenantsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put tenants params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutTenantsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the put tenants params +func (o *PutTenantsParams) WithTimeout(timeout time.Duration) *PutTenantsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put tenants params +func (o *PutTenantsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put tenants params +func (o *PutTenantsParams) WithContext(ctx context.Context) *PutTenantsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put tenants params +func (o *PutTenantsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put tenants params +func (o *PutTenantsParams) WithHTTPClient(client *http.Client) *PutTenantsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put tenants params +func (o *PutTenantsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTenantRequest adds the tenantRequest to the put tenants params +func (o *PutTenantsParams) WithTenantRequest(tenantRequest *devops_models.TenantRequest) *PutTenantsParams { + o.SetTenantRequest(tenantRequest) + return o +} + +// SetTenantRequest adds the tenantRequest to the put tenants params +func (o *PutTenantsParams) SetTenantRequest(tenantRequest *devops_models.TenantRequest) { + o.TenantRequest = tenantRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutTenantsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.TenantRequest != nil { + if err := r.SetBodyParam(o.TenantRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/tenant/put_tenants_responses.go b/api/devops/devops_client/tenant/put_tenants_responses.go new file mode 100644 index 0000000..834055a --- /dev/null +++ b/api/devops/devops_client/tenant/put_tenants_responses.go @@ -0,0 +1,331 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tenant + +// 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/telnexus/lib/api/devops/devops_models" +) + +// PutTenantsReader is a Reader for the PutTenants structure. +type PutTenantsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutTenantsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutTenantsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutTenantsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutTenantsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutTenantsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutTenantsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutTenantsInternalServerError() + 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()) + } +} + +// NewPutTenantsOK creates a PutTenantsOK with default headers values +func NewPutTenantsOK() *PutTenantsOK { + return &PutTenantsOK{} +} + +/* PutTenantsOK describes a response with status code 200, with default header values. + +Telnexus Response with Tenant objects +*/ +type PutTenantsOK struct { + AccessControlAllowOrigin string + + Payload *devops_models.TenantResponse +} + +func (o *PutTenantsOK) Error() string { + return fmt.Sprintf("[PUT /tenants][%d] putTenantsOK %+v", 200, o.Payload) +} +func (o *PutTenantsOK) GetPayload() *devops_models.TenantResponse { + return o.Payload +} + +func (o *PutTenantsOK) 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(devops_models.TenantResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutTenantsUnauthorized creates a PutTenantsUnauthorized with default headers values +func NewPutTenantsUnauthorized() *PutTenantsUnauthorized { + return &PutTenantsUnauthorized{} +} + +/* PutTenantsUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutTenantsUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PutTenantsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /tenants][%d] putTenantsUnauthorized %+v", 401, o.Payload) +} +func (o *PutTenantsUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutTenantsUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutTenantsForbidden creates a PutTenantsForbidden with default headers values +func NewPutTenantsForbidden() *PutTenantsForbidden { + return &PutTenantsForbidden{} +} + +/* PutTenantsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PutTenantsForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PutTenantsForbidden) Error() string { + return fmt.Sprintf("[PUT /tenants][%d] putTenantsForbidden %+v", 403, o.Payload) +} +func (o *PutTenantsForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutTenantsForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutTenantsNotFound creates a PutTenantsNotFound with default headers values +func NewPutTenantsNotFound() *PutTenantsNotFound { + return &PutTenantsNotFound{} +} + +/* PutTenantsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PutTenantsNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PutTenantsNotFound) Error() string { + return fmt.Sprintf("[PUT /tenants][%d] putTenantsNotFound %+v", 404, o.Payload) +} +func (o *PutTenantsNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutTenantsNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutTenantsUnprocessableEntity creates a PutTenantsUnprocessableEntity with default headers values +func NewPutTenantsUnprocessableEntity() *PutTenantsUnprocessableEntity { + return &PutTenantsUnprocessableEntity{} +} + +/* PutTenantsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutTenantsUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PutTenantsUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /tenants][%d] putTenantsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PutTenantsUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutTenantsUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutTenantsInternalServerError creates a PutTenantsInternalServerError with default headers values +func NewPutTenantsInternalServerError() *PutTenantsInternalServerError { + return &PutTenantsInternalServerError{} +} + +/* PutTenantsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PutTenantsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PutTenantsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /tenants][%d] putTenantsInternalServerError %+v", 500, o.Payload) +} +func (o *PutTenantsInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutTenantsInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/tenant/tenant_client.go b/api/devops/devops_client/tenant/tenant_client.go new file mode 100644 index 0000000..8cc24c8 --- /dev/null +++ b/api/devops/devops_client/tenant/tenant_client.go @@ -0,0 +1,258 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tenant + +// 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 tenant API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for tenant 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 { + GetTenant(params *GetTenantParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTenantOK, error) + + GetTenants(params *GetTenantsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTenantsOK, error) + + GetTenantsObservable(params *GetTenantsObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTenantsObservableOK, error) + + PostTenants(params *PostTenantsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTenantsOK, error) + + PutTenants(params *PutTenantsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutTenantsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetTenant gets a single tenant object + + Return a single Tenant object from datastore as a Singleton +*/ +func (a *Client) GetTenant(params *GetTenantParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTenantOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTenantParams() + } + op := &runtime.ClientOperation{ + ID: "getTenant", + Method: "GET", + PathPattern: "/tenants/{tenantIdPath}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTenantReader{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.(*GetTenantOK) + 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 getTenant: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetTenants gets a list tenants + + Return a list of Tenant records from the datastore +*/ +func (a *Client) GetTenants(params *GetTenantsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTenantsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTenantsParams() + } + op := &runtime.ClientOperation{ + ID: "getTenants", + Method: "GET", + PathPattern: "/tenants", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTenantsReader{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.(*GetTenantsOK) + 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 getTenants: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetTenantsObservable gets tenants in an observable array + + Returns a Tenant retrieval in a observable array +*/ +func (a *Client) GetTenantsObservable(params *GetTenantsObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTenantsObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTenantsObservableParams() + } + op := &runtime.ClientOperation{ + ID: "getTenantsObservable", + Method: "GET", + PathPattern: "/tenants/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTenantsObservableReader{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.(*GetTenantsObservableOK) + 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 getTenantsObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostTenants creates new tenants + + Create Tenants in Telnexus +*/ +func (a *Client) PostTenants(params *PostTenantsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTenantsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostTenantsParams() + } + op := &runtime.ClientOperation{ + ID: "postTenants", + Method: "POST", + PathPattern: "/tenants", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostTenantsReader{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.(*PostTenantsOK) + 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 postTenants: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutTenants updates tenants + + Update Tenant in Telnexus +*/ +func (a *Client) PutTenants(params *PutTenantsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutTenantsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutTenantsParams() + } + op := &runtime.ClientOperation{ + ID: "putTenants", + Method: "PUT", + PathPattern: "/tenants", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutTenantsReader{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.(*PutTenantsOK) + 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 putTenants: 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 +} diff --git a/api/devops/devops_client/user/get_user_parameters.go b/api/devops/devops_client/user/get_user_parameters.go new file mode 100644 index 0000000..993ca34 --- /dev/null +++ b/api/devops/devops_client/user/get_user_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetUserParams creates a new GetUserParams 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 NewGetUserParams() *GetUserParams { + return &GetUserParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetUserParamsWithTimeout creates a new GetUserParams object +// with the ability to set a timeout on a request. +func NewGetUserParamsWithTimeout(timeout time.Duration) *GetUserParams { + return &GetUserParams{ + timeout: timeout, + } +} + +// NewGetUserParamsWithContext creates a new GetUserParams object +// with the ability to set a context for a request. +func NewGetUserParamsWithContext(ctx context.Context) *GetUserParams { + return &GetUserParams{ + Context: ctx, + } +} + +// NewGetUserParamsWithHTTPClient creates a new GetUserParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetUserParamsWithHTTPClient(client *http.Client) *GetUserParams { + return &GetUserParams{ + HTTPClient: client, + } +} + +/* GetUserParams contains all the parameters to send to the API endpoint + for the get user operation. + + Typically these are written to a http.Request. +*/ +type GetUserParams struct { + + /* UserIDPath. + + Telnexus Record Id of a User + */ + UserIDPath string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetUserParams) WithDefaults() *GetUserParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetUserParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get user params +func (o *GetUserParams) WithTimeout(timeout time.Duration) *GetUserParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get user params +func (o *GetUserParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get user params +func (o *GetUserParams) WithContext(ctx context.Context) *GetUserParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get user params +func (o *GetUserParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get user params +func (o *GetUserParams) WithHTTPClient(client *http.Client) *GetUserParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get user params +func (o *GetUserParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithUserIDPath adds the userIDPath to the get user params +func (o *GetUserParams) WithUserIDPath(userIDPath string) *GetUserParams { + o.SetUserIDPath(userIDPath) + return o +} + +// SetUserIDPath adds the userIdPath to the get user params +func (o *GetUserParams) SetUserIDPath(userIDPath string) { + o.UserIDPath = userIDPath +} + +// WriteToRequest writes these params to a swagger request +func (o *GetUserParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param userIdPath + if err := r.SetPathParam("userIdPath", o.UserIDPath); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/user/get_user_responses.go b/api/devops/devops_client/user/get_user_responses.go new file mode 100644 index 0000000..fda5c02 --- /dev/null +++ b/api/devops/devops_client/user/get_user_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/devops/devops_models" +) + +// GetUserReader is a Reader for the GetUser structure. +type GetUserReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetUserOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetUserUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetUserForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetUserNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetUserUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetUserInternalServerError() + 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()) + } +} + +// NewGetUserOK creates a GetUserOK with default headers values +func NewGetUserOK() *GetUserOK { + return &GetUserOK{} +} + +/* GetUserOK describes a response with status code 200, with default header values. + +Single User record response +*/ +type GetUserOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.User +} + +func (o *GetUserOK) Error() string { + return fmt.Sprintf("[GET /users/{userIdPath}][%d] getUserOK %+v", 200, o.Payload) +} +func (o *GetUserOK) GetPayload() *devops_models.User { + return o.Payload +} + +func (o *GetUserOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.User) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUserUnauthorized creates a GetUserUnauthorized with default headers values +func NewGetUserUnauthorized() *GetUserUnauthorized { + return &GetUserUnauthorized{} +} + +/* GetUserUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetUserUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetUserUnauthorized) Error() string { + return fmt.Sprintf("[GET /users/{userIdPath}][%d] getUserUnauthorized %+v", 401, o.Payload) +} +func (o *GetUserUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetUserUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUserForbidden creates a GetUserForbidden with default headers values +func NewGetUserForbidden() *GetUserForbidden { + return &GetUserForbidden{} +} + +/* GetUserForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetUserForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetUserForbidden) Error() string { + return fmt.Sprintf("[GET /users/{userIdPath}][%d] getUserForbidden %+v", 403, o.Payload) +} +func (o *GetUserForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetUserForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUserNotFound creates a GetUserNotFound with default headers values +func NewGetUserNotFound() *GetUserNotFound { + return &GetUserNotFound{} +} + +/* GetUserNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetUserNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetUserNotFound) Error() string { + return fmt.Sprintf("[GET /users/{userIdPath}][%d] getUserNotFound %+v", 404, o.Payload) +} +func (o *GetUserNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetUserNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUserUnprocessableEntity creates a GetUserUnprocessableEntity with default headers values +func NewGetUserUnprocessableEntity() *GetUserUnprocessableEntity { + return &GetUserUnprocessableEntity{} +} + +/* GetUserUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetUserUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetUserUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /users/{userIdPath}][%d] getUserUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetUserUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetUserUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUserInternalServerError creates a GetUserInternalServerError with default headers values +func NewGetUserInternalServerError() *GetUserInternalServerError { + return &GetUserInternalServerError{} +} + +/* GetUserInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetUserInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetUserInternalServerError) Error() string { + return fmt.Sprintf("[GET /users/{userIdPath}][%d] getUserInternalServerError %+v", 500, o.Payload) +} +func (o *GetUserInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetUserInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/user/get_users_observable_parameters.go b/api/devops/devops_client/user/get_users_observable_parameters.go new file mode 100644 index 0000000..0f4bfad --- /dev/null +++ b/api/devops/devops_client/user/get_users_observable_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetUsersObservableParams creates a new GetUsersObservableParams 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 NewGetUsersObservableParams() *GetUsersObservableParams { + return &GetUsersObservableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetUsersObservableParamsWithTimeout creates a new GetUsersObservableParams object +// with the ability to set a timeout on a request. +func NewGetUsersObservableParamsWithTimeout(timeout time.Duration) *GetUsersObservableParams { + return &GetUsersObservableParams{ + timeout: timeout, + } +} + +// NewGetUsersObservableParamsWithContext creates a new GetUsersObservableParams object +// with the ability to set a context for a request. +func NewGetUsersObservableParamsWithContext(ctx context.Context) *GetUsersObservableParams { + return &GetUsersObservableParams{ + Context: ctx, + } +} + +// NewGetUsersObservableParamsWithHTTPClient creates a new GetUsersObservableParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetUsersObservableParamsWithHTTPClient(client *http.Client) *GetUsersObservableParams { + return &GetUsersObservableParams{ + HTTPClient: client, + } +} + +/* GetUsersObservableParams contains all the parameters to send to the API endpoint + for the get users observable operation. + + Typically these are written to a http.Request. +*/ +type GetUsersObservableParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get users observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetUsersObservableParams) WithDefaults() *GetUsersObservableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get users observable params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetUsersObservableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get users observable params +func (o *GetUsersObservableParams) WithTimeout(timeout time.Duration) *GetUsersObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get users observable params +func (o *GetUsersObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get users observable params +func (o *GetUsersObservableParams) WithContext(ctx context.Context) *GetUsersObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get users observable params +func (o *GetUsersObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get users observable params +func (o *GetUsersObservableParams) WithHTTPClient(client *http.Client) *GetUsersObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get users observable params +func (o *GetUsersObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetUsersObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/user/get_users_observable_responses.go b/api/devops/devops_client/user/get_users_observable_responses.go new file mode 100644 index 0000000..8fa93c2 --- /dev/null +++ b/api/devops/devops_client/user/get_users_observable_responses.go @@ -0,0 +1,337 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/devops/devops_models" +) + +// GetUsersObservableReader is a Reader for the GetUsersObservable structure. +type GetUsersObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetUsersObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetUsersObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetUsersObservableUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetUsersObservableForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetUsersObservableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetUsersObservableUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetUsersObservableInternalServerError() + 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()) + } +} + +// NewGetUsersObservableOK creates a GetUsersObservableOK with default headers values +func NewGetUsersObservableOK() *GetUsersObservableOK { + return &GetUsersObservableOK{} +} + +/* GetUsersObservableOK describes a response with status code 200, with default header values. + +Simple User record response +*/ +type GetUsersObservableOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload []*devops_models.User +} + +func (o *GetUsersObservableOK) Error() string { + return fmt.Sprintf("[GET /users/observable][%d] getUsersObservableOK %+v", 200, o.Payload) +} +func (o *GetUsersObservableOK) GetPayload() []*devops_models.User { + return o.Payload +} + +func (o *GetUsersObservableOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUsersObservableUnauthorized creates a GetUsersObservableUnauthorized with default headers values +func NewGetUsersObservableUnauthorized() *GetUsersObservableUnauthorized { + return &GetUsersObservableUnauthorized{} +} + +/* GetUsersObservableUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetUsersObservableUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetUsersObservableUnauthorized) Error() string { + return fmt.Sprintf("[GET /users/observable][%d] getUsersObservableUnauthorized %+v", 401, o.Payload) +} +func (o *GetUsersObservableUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetUsersObservableUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUsersObservableForbidden creates a GetUsersObservableForbidden with default headers values +func NewGetUsersObservableForbidden() *GetUsersObservableForbidden { + return &GetUsersObservableForbidden{} +} + +/* GetUsersObservableForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetUsersObservableForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetUsersObservableForbidden) Error() string { + return fmt.Sprintf("[GET /users/observable][%d] getUsersObservableForbidden %+v", 403, o.Payload) +} +func (o *GetUsersObservableForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetUsersObservableForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUsersObservableNotFound creates a GetUsersObservableNotFound with default headers values +func NewGetUsersObservableNotFound() *GetUsersObservableNotFound { + return &GetUsersObservableNotFound{} +} + +/* GetUsersObservableNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetUsersObservableNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetUsersObservableNotFound) Error() string { + return fmt.Sprintf("[GET /users/observable][%d] getUsersObservableNotFound %+v", 404, o.Payload) +} +func (o *GetUsersObservableNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetUsersObservableNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUsersObservableUnprocessableEntity creates a GetUsersObservableUnprocessableEntity with default headers values +func NewGetUsersObservableUnprocessableEntity() *GetUsersObservableUnprocessableEntity { + return &GetUsersObservableUnprocessableEntity{} +} + +/* GetUsersObservableUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetUsersObservableUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetUsersObservableUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /users/observable][%d] getUsersObservableUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetUsersObservableUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetUsersObservableUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUsersObservableInternalServerError creates a GetUsersObservableInternalServerError with default headers values +func NewGetUsersObservableInternalServerError() *GetUsersObservableInternalServerError { + return &GetUsersObservableInternalServerError{} +} + +/* GetUsersObservableInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetUsersObservableInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetUsersObservableInternalServerError) Error() string { + return fmt.Sprintf("[GET /users/observable][%d] getUsersObservableInternalServerError %+v", 500, o.Payload) +} +func (o *GetUsersObservableInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetUsersObservableInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/user/get_users_parameters.go b/api/devops/devops_client/user/get_users_parameters.go new file mode 100644 index 0000000..aefde18 --- /dev/null +++ b/api/devops/devops_client/user/get_users_parameters.go @@ -0,0 +1,408 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + "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" +) + +// NewGetUsersParams creates a new GetUsersParams 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 NewGetUsersParams() *GetUsersParams { + return &GetUsersParams{ + timeout: 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, + } +} + +// NewGetUsersParamsWithContext creates a new GetUsersParams object +// with the ability to set a context for a request. +func NewGetUsersParamsWithContext(ctx context.Context) *GetUsersParams { + return &GetUsersParams{ + Context: ctx, + } +} + +// NewGetUsersParamsWithHTTPClient creates a new GetUsersParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetUsersParamsWithHTTPClient(client *http.Client) *GetUsersParams { + return &GetUsersParams{ + HTTPClient: client, + } +} + +/* GetUsersParams contains all the parameters to send to the API endpoint + for the get users operation. + + Typically these are written to a http.Request. +*/ +type GetUsersParams struct { + + /* AccountID. + + Telnexus Record Id of an Account + */ + AccountID *string + + /* Active. + + Retrieve active records only? + */ + Active *bool + + /* ContactID. + + Telnexus Record Id of a Contact + */ + ContactID *string + + /* Email. + + Email Address (not unique) + */ + Email *string + + /* Limit. + + How many objects to return at one time + + Format: int64 + */ + Limit *int64 + + /* Offset. + + How many objects to skip? (default 0) + + Format: int64 + */ + Offset *int64 + + /* UserID. + + Telnexus User ID (unique) + */ + UserID *string + + /* Username. + + Username (unique) + */ + Username *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetUsersParams) WithDefaults() *GetUsersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetUsersParams) SetDefaults() { + // no default values defined for this parameter +} + +// 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 +func (o *GetUsersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get users params +func (o *GetUsersParams) WithContext(ctx context.Context) *GetUsersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get users params +func (o *GetUsersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// 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 +func (o *GetUsersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get users params +func (o *GetUsersParams) WithAccountID(accountID *string) *GetUsersParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get users params +func (o *GetUsersParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithActive adds the active to the get users params +func (o *GetUsersParams) WithActive(active *bool) *GetUsersParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get users params +func (o *GetUsersParams) SetActive(active *bool) { + o.Active = active +} + +// WithContactID adds the contactID to the get users params +func (o *GetUsersParams) WithContactID(contactID *string) *GetUsersParams { + o.SetContactID(contactID) + return o +} + +// SetContactID adds the contactId to the get users params +func (o *GetUsersParams) SetContactID(contactID *string) { + o.ContactID = contactID +} + +// WithEmail adds the email to the get users params +func (o *GetUsersParams) WithEmail(email *string) *GetUsersParams { + o.SetEmail(email) + return o +} + +// SetEmail adds the email to the get users params +func (o *GetUsersParams) SetEmail(email *string) { + o.Email = email +} + +// WithLimit adds the limit to the get users params +func (o *GetUsersParams) WithLimit(limit *int64) *GetUsersParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get users params +func (o *GetUsersParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get users params +func (o *GetUsersParams) WithOffset(offset *int64) *GetUsersParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get users params +func (o *GetUsersParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithUserID adds the userID to the get users params +func (o *GetUsersParams) WithUserID(userID *string) *GetUsersParams { + o.SetUserID(userID) + return o +} + +// SetUserID adds the userId to the get users params +func (o *GetUsersParams) SetUserID(userID *string) { + o.UserID = userID +} + +// WithUsername adds the username to the get users params +func (o *GetUsersParams) WithUsername(username *string) *GetUsersParams { + o.SetUsername(username) + return o +} + +// SetUsername adds the username to the get users params +func (o *GetUsersParams) SetUsername(username *string) { + o.Username = username +} + +// WriteToRequest writes these params to a swagger request +func (o *GetUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AccountID != nil { + + // query param accountId + var qrAccountID string + + if o.AccountID != nil { + qrAccountID = *o.AccountID + } + qAccountID := qrAccountID + if qAccountID != "" { + + if err := r.SetQueryParam("accountId", qAccountID); err != nil { + return err + } + } + } + + if o.Active != nil { + + // query param active + var qrActive bool + + if o.Active != nil { + qrActive = *o.Active + } + qActive := swag.FormatBool(qrActive) + if qActive != "" { + + if err := r.SetQueryParam("active", qActive); err != nil { + return err + } + } + } + + if o.ContactID != nil { + + // query param contactId + var qrContactID string + + if o.ContactID != nil { + qrContactID = *o.ContactID + } + qContactID := qrContactID + if qContactID != "" { + + if err := r.SetQueryParam("contactId", qContactID); err != nil { + return err + } + } + } + + if o.Email != nil { + + // query param email + var qrEmail string + + if o.Email != nil { + qrEmail = *o.Email + } + qEmail := qrEmail + if qEmail != "" { + + if err := r.SetQueryParam("email", qEmail); 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 o.UserID != nil { + + // query param userId + var qrUserID string + + if o.UserID != nil { + qrUserID = *o.UserID + } + qUserID := qrUserID + if qUserID != "" { + + if err := r.SetQueryParam("userId", qUserID); err != nil { + return err + } + } + } + + if o.Username != nil { + + // query param username + var qrUsername string + + if o.Username != nil { + qrUsername = *o.Username + } + qUsername := qrUsername + if qUsername != "" { + + if err := r.SetQueryParam("username", qUsername); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/user/get_users_responses.go b/api/devops/devops_client/user/get_users_responses.go new file mode 100644 index 0000000..e310be9 --- /dev/null +++ b/api/devops/devops_client/user/get_users_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/devops/devops_models" +) + +// GetUsersReader is a Reader for the GetUsers structure. +type GetUsersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetUsersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetUsersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetUsersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetUsersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetUsersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetUsersInternalServerError() + 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()) + } +} + +// NewGetUsersOK creates a GetUsersOK with default headers values +func NewGetUsersOK() *GetUsersOK { + return &GetUsersOK{} +} + +/* GetUsersOK describes a response with status code 200, with default header values. + +Telnexus Response with User objects +*/ +type GetUsersOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.UserResponse +} + +func (o *GetUsersOK) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersOK %+v", 200, o.Payload) +} +func (o *GetUsersOK) GetPayload() *devops_models.UserResponse { + return o.Payload +} + +func (o *GetUsersOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.UserResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUsersUnauthorized creates a GetUsersUnauthorized with default headers values +func NewGetUsersUnauthorized() *GetUsersUnauthorized { + return &GetUsersUnauthorized{} +} + +/* GetUsersUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetUsersUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetUsersUnauthorized) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersUnauthorized %+v", 401, o.Payload) +} +func (o *GetUsersUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetUsersUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUsersForbidden creates a GetUsersForbidden with default headers values +func NewGetUsersForbidden() *GetUsersForbidden { + return &GetUsersForbidden{} +} + +/* GetUsersForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetUsersForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetUsersForbidden) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersForbidden %+v", 403, o.Payload) +} +func (o *GetUsersForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetUsersForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUsersNotFound creates a GetUsersNotFound with default headers values +func NewGetUsersNotFound() *GetUsersNotFound { + return &GetUsersNotFound{} +} + +/* GetUsersNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetUsersNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetUsersNotFound) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersNotFound %+v", 404, o.Payload) +} +func (o *GetUsersNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetUsersNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUsersUnprocessableEntity creates a GetUsersUnprocessableEntity with default headers values +func NewGetUsersUnprocessableEntity() *GetUsersUnprocessableEntity { + return &GetUsersUnprocessableEntity{} +} + +/* GetUsersUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetUsersUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *GetUsersUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetUsersUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetUsersUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUsersInternalServerError creates a GetUsersInternalServerError with default headers values +func NewGetUsersInternalServerError() *GetUsersInternalServerError { + return &GetUsersInternalServerError{} +} + +/* GetUsersInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetUsersInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *GetUsersInternalServerError) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersInternalServerError %+v", 500, o.Payload) +} +func (o *GetUsersInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *GetUsersInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/user/post_users_parameters.go b/api/devops/devops_client/user/post_users_parameters.go new file mode 100644 index 0000000..6050225 --- /dev/null +++ b/api/devops/devops_client/user/post_users_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + "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/telnexus/lib/api/devops/devops_models" +) + +// NewPostUsersParams creates a new PostUsersParams 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 NewPostUsersParams() *PostUsersParams { + return &PostUsersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostUsersParamsWithTimeout creates a new PostUsersParams object +// with the ability to set a timeout on a request. +func NewPostUsersParamsWithTimeout(timeout time.Duration) *PostUsersParams { + return &PostUsersParams{ + timeout: timeout, + } +} + +// NewPostUsersParamsWithContext creates a new PostUsersParams object +// with the ability to set a context for a request. +func NewPostUsersParamsWithContext(ctx context.Context) *PostUsersParams { + return &PostUsersParams{ + Context: ctx, + } +} + +// NewPostUsersParamsWithHTTPClient creates a new PostUsersParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostUsersParamsWithHTTPClient(client *http.Client) *PostUsersParams { + return &PostUsersParams{ + HTTPClient: client, + } +} + +/* PostUsersParams contains all the parameters to send to the API endpoint + for the post users operation. + + Typically these are written to a http.Request. +*/ +type PostUsersParams struct { + + /* UserRequest. + + An array of User records + */ + UserRequest *devops_models.UserRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostUsersParams) WithDefaults() *PostUsersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostUsersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post users params +func (o *PostUsersParams) WithTimeout(timeout time.Duration) *PostUsersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post users params +func (o *PostUsersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post users params +func (o *PostUsersParams) WithContext(ctx context.Context) *PostUsersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post users params +func (o *PostUsersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post users params +func (o *PostUsersParams) WithHTTPClient(client *http.Client) *PostUsersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post users params +func (o *PostUsersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithUserRequest adds the userRequest to the post users params +func (o *PostUsersParams) WithUserRequest(userRequest *devops_models.UserRequest) *PostUsersParams { + o.SetUserRequest(userRequest) + return o +} + +// SetUserRequest adds the userRequest to the post users params +func (o *PostUsersParams) SetUserRequest(userRequest *devops_models.UserRequest) { + o.UserRequest = userRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.UserRequest != nil { + if err := r.SetBodyParam(o.UserRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/user/post_users_responses.go b/api/devops/devops_client/user/post_users_responses.go new file mode 100644 index 0000000..725773a --- /dev/null +++ b/api/devops/devops_client/user/post_users_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/devops/devops_models" +) + +// PostUsersReader is a Reader for the PostUsers structure. +type PostUsersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostUsersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostUsersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostUsersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostUsersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostUsersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostUsersInternalServerError() + 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()) + } +} + +// NewPostUsersOK creates a PostUsersOK with default headers values +func NewPostUsersOK() *PostUsersOK { + return &PostUsersOK{} +} + +/* PostUsersOK describes a response with status code 200, with default header values. + +Telnexus Response with User objects +*/ +type PostUsersOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.UserResponse +} + +func (o *PostUsersOK) Error() string { + return fmt.Sprintf("[POST /users][%d] postUsersOK %+v", 200, o.Payload) +} +func (o *PostUsersOK) GetPayload() *devops_models.UserResponse { + return o.Payload +} + +func (o *PostUsersOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.UserResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostUsersUnauthorized creates a PostUsersUnauthorized with default headers values +func NewPostUsersUnauthorized() *PostUsersUnauthorized { + return &PostUsersUnauthorized{} +} + +/* PostUsersUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostUsersUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PostUsersUnauthorized) Error() string { + return fmt.Sprintf("[POST /users][%d] postUsersUnauthorized %+v", 401, o.Payload) +} +func (o *PostUsersUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostUsersUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostUsersForbidden creates a PostUsersForbidden with default headers values +func NewPostUsersForbidden() *PostUsersForbidden { + return &PostUsersForbidden{} +} + +/* PostUsersForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostUsersForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostUsersForbidden) Error() string { + return fmt.Sprintf("[POST /users][%d] postUsersForbidden %+v", 403, o.Payload) +} +func (o *PostUsersForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostUsersForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostUsersNotFound creates a PostUsersNotFound with default headers values +func NewPostUsersNotFound() *PostUsersNotFound { + return &PostUsersNotFound{} +} + +/* PostUsersNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostUsersNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostUsersNotFound) Error() string { + return fmt.Sprintf("[POST /users][%d] postUsersNotFound %+v", 404, o.Payload) +} +func (o *PostUsersNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostUsersNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostUsersUnprocessableEntity creates a PostUsersUnprocessableEntity with default headers values +func NewPostUsersUnprocessableEntity() *PostUsersUnprocessableEntity { + return &PostUsersUnprocessableEntity{} +} + +/* PostUsersUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostUsersUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PostUsersUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /users][%d] postUsersUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PostUsersUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostUsersUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostUsersInternalServerError creates a PostUsersInternalServerError with default headers values +func NewPostUsersInternalServerError() *PostUsersInternalServerError { + return &PostUsersInternalServerError{} +} + +/* PostUsersInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostUsersInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PostUsersInternalServerError) Error() string { + return fmt.Sprintf("[POST /users][%d] postUsersInternalServerError %+v", 500, o.Payload) +} +func (o *PostUsersInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PostUsersInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/user/put_users_parameters.go b/api/devops/devops_client/user/put_users_parameters.go new file mode 100644 index 0000000..2086995 --- /dev/null +++ b/api/devops/devops_client/user/put_users_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + "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/telnexus/lib/api/devops/devops_models" +) + +// NewPutUsersParams creates a new PutUsersParams 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 NewPutUsersParams() *PutUsersParams { + return &PutUsersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPutUsersParamsWithTimeout creates a new PutUsersParams object +// with the ability to set a timeout on a request. +func NewPutUsersParamsWithTimeout(timeout time.Duration) *PutUsersParams { + return &PutUsersParams{ + timeout: timeout, + } +} + +// NewPutUsersParamsWithContext creates a new PutUsersParams object +// with the ability to set a context for a request. +func NewPutUsersParamsWithContext(ctx context.Context) *PutUsersParams { + return &PutUsersParams{ + Context: ctx, + } +} + +// NewPutUsersParamsWithHTTPClient creates a new PutUsersParams object +// with the ability to set a custom HTTPClient for a request. +func NewPutUsersParamsWithHTTPClient(client *http.Client) *PutUsersParams { + return &PutUsersParams{ + HTTPClient: client, + } +} + +/* PutUsersParams contains all the parameters to send to the API endpoint + for the put users operation. + + Typically these are written to a http.Request. +*/ +type PutUsersParams struct { + + /* UserRequest. + + An array of User records + */ + UserRequest *devops_models.UserRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutUsersParams) WithDefaults() *PutUsersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutUsersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the put users params +func (o *PutUsersParams) WithTimeout(timeout time.Duration) *PutUsersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put users params +func (o *PutUsersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put users params +func (o *PutUsersParams) WithContext(ctx context.Context) *PutUsersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put users params +func (o *PutUsersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put users params +func (o *PutUsersParams) WithHTTPClient(client *http.Client) *PutUsersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put users params +func (o *PutUsersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithUserRequest adds the userRequest to the put users params +func (o *PutUsersParams) WithUserRequest(userRequest *devops_models.UserRequest) *PutUsersParams { + o.SetUserRequest(userRequest) + return o +} + +// SetUserRequest adds the userRequest to the put users params +func (o *PutUsersParams) SetUserRequest(userRequest *devops_models.UserRequest) { + o.UserRequest = userRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.UserRequest != nil { + if err := r.SetBodyParam(o.UserRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/devops/devops_client/user/put_users_responses.go b/api/devops/devops_client/user/put_users_responses.go new file mode 100644 index 0000000..8b9da4b --- /dev/null +++ b/api/devops/devops_client/user/put_users_responses.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/devops/devops_models" +) + +// PutUsersReader is a Reader for the PutUsers structure. +type PutUsersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutUsersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutUsersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutUsersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutUsersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutUsersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutUsersInternalServerError() + 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()) + } +} + +// NewPutUsersOK creates a PutUsersOK with default headers values +func NewPutUsersOK() *PutUsersOK { + return &PutUsersOK{} +} + +/* PutUsersOK describes a response with status code 200, with default header values. + +Telnexus Response with User objects +*/ +type PutUsersOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.UserResponse +} + +func (o *PutUsersOK) Error() string { + return fmt.Sprintf("[PUT /users][%d] putUsersOK %+v", 200, o.Payload) +} +func (o *PutUsersOK) GetPayload() *devops_models.UserResponse { + return o.Payload +} + +func (o *PutUsersOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.UserResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutUsersUnauthorized creates a PutUsersUnauthorized with default headers values +func NewPutUsersUnauthorized() *PutUsersUnauthorized { + return &PutUsersUnauthorized{} +} + +/* PutUsersUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutUsersUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PutUsersUnauthorized) Error() string { + return fmt.Sprintf("[PUT /users][%d] putUsersUnauthorized %+v", 401, o.Payload) +} +func (o *PutUsersUnauthorized) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutUsersUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutUsersForbidden creates a PutUsersForbidden with default headers values +func NewPutUsersForbidden() *PutUsersForbidden { + return &PutUsersForbidden{} +} + +/* PutUsersForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PutUsersForbidden struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PutUsersForbidden) Error() string { + return fmt.Sprintf("[PUT /users][%d] putUsersForbidden %+v", 403, o.Payload) +} +func (o *PutUsersForbidden) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutUsersForbidden) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutUsersNotFound creates a PutUsersNotFound with default headers values +func NewPutUsersNotFound() *PutUsersNotFound { + return &PutUsersNotFound{} +} + +/* PutUsersNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PutUsersNotFound struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PutUsersNotFound) Error() string { + return fmt.Sprintf("[PUT /users][%d] putUsersNotFound %+v", 404, o.Payload) +} +func (o *PutUsersNotFound) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutUsersNotFound) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutUsersUnprocessableEntity creates a PutUsersUnprocessableEntity with default headers values +func NewPutUsersUnprocessableEntity() *PutUsersUnprocessableEntity { + return &PutUsersUnprocessableEntity{} +} + +/* PutUsersUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutUsersUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *devops_models.Error +} + +func (o *PutUsersUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /users][%d] putUsersUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PutUsersUnprocessableEntity) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutUsersUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutUsersInternalServerError creates a PutUsersInternalServerError with default headers values +func NewPutUsersInternalServerError() *PutUsersInternalServerError { + return &PutUsersInternalServerError{} +} + +/* PutUsersInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PutUsersInternalServerError struct { + AccessControlAllowOrigin string + + Payload *devops_models.Error +} + +func (o *PutUsersInternalServerError) Error() string { + return fmt.Sprintf("[PUT /users][%d] putUsersInternalServerError %+v", 500, o.Payload) +} +func (o *PutUsersInternalServerError) GetPayload() *devops_models.Error { + return o.Payload +} + +func (o *PutUsersInternalServerError) 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(devops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/devops/devops_client/user/user_client.go b/api/devops/devops_client/user/user_client.go new file mode 100644 index 0000000..adb80d8 --- /dev/null +++ b/api/devops/devops_client/user/user_client.go @@ -0,0 +1,258 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new user API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for user 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 { + GetUser(params *GetUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUserOK, error) + + GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUsersOK, error) + + GetUsersObservable(params *GetUsersObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUsersObservableOK, error) + + PostUsers(params *PostUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostUsersOK, error) + + PutUsers(params *PutUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutUsersOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetUser gets a single user object + + Return a single User object from datastore as a Singleton +*/ +func (a *Client) GetUser(params *GetUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUserOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetUserParams() + } + op := &runtime.ClientOperation{ + ID: "getUser", + Method: "GET", + PathPattern: "/users/{userIdPath}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetUserReader{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.(*GetUserOK) + 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 getUser: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetUsers gets a list users + + Return a list of User records from the datastore +*/ +func (a *Client) GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUsersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetUsersParams() + } + op := &runtime.ClientOperation{ + ID: "getUsers", + Method: "GET", + PathPattern: "/users", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + 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) + if err != nil { + return nil, err + } + 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 + 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) +} + +/* + GetUsersObservable gets users in an observable array + + Returns a User retrieval in a observable array +*/ +func (a *Client) GetUsersObservable(params *GetUsersObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUsersObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetUsersObservableParams() + } + op := &runtime.ClientOperation{ + ID: "getUsersObservable", + Method: "GET", + PathPattern: "/users/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetUsersObservableReader{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.(*GetUsersObservableOK) + 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 getUsersObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostUsers creates new users + + Create new Users +*/ +func (a *Client) PostUsers(params *PostUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostUsersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostUsersParams() + } + op := &runtime.ClientOperation{ + ID: "postUsers", + Method: "POST", + PathPattern: "/users", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostUsersReader{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.(*PostUsersOK) + 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 postUsers: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutUsers updates existing users + + Update existing users +*/ +func (a *Client) PutUsers(params *PutUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutUsersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutUsersParams() + } + op := &runtime.ClientOperation{ + ID: "putUsers", + Method: "PUT", + PathPattern: "/users", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutUsersReader{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.(*PutUsersOK) + 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 putUsers: 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 +} diff --git a/api/devops/devops_models/address.go b/api/devops/devops_models/address.go new file mode 100644 index 0000000..407c757 --- /dev/null +++ b/api/devops/devops_models/address.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_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" +) + +// Address address +// +// swagger:model Address +type Address struct { + + // City + City string `json:"City,omitempty"` + + // Country full name + Country string `json:"Country,omitempty"` + + // Country Code + CountryCode string `json:"CountryCode,omitempty"` + + // Postal Code + PostalCode string `json:"PostalCode,omitempty"` + + // State full name + State string `json:"State,omitempty"` + + // State Code + StateCode string `json:"StateCode,omitempty"` + + // Street number and name + Street string `json:"Street,omitempty"` +} + +// Validate validates this address +func (m *Address) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this address based on context it is used +func (m *Address) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Address) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Address) UnmarshalBinary(b []byte) error { + var res Address + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/cluster.go b/api/devops/devops_models/cluster.go new file mode 100644 index 0000000..13fee34 --- /dev/null +++ b/api/devops/devops_models/cluster.go @@ -0,0 +1,102 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_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" +) + +// Cluster cluster +// +// swagger:model Cluster +type Cluster struct { + + // Created By + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // Environment + Environment string `json:"Environment,omitempty"` + + // Gateway + Gateway string `json:"Gateway,omitempty"` + + // Telnexus Record Id + ID string `json:"ID,omitempty"` + + // IP Address + IPAddress string `json:"IPAddress,omitempty"` + + // Last Modified By + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Cluster Name + Name string `json:"Name,omitempty"` + + // Owner + OwnerID string `json:"OwnerID,omitempty"` + + // External Reference + Ref string `json:"Ref,omitempty"` + + // Status + Status string `json:"Status,omitempty"` + + // Subnet + Subnet string `json:"Subnet,omitempty"` + + // The ID of the tenant who owns this Database + TenantID string `json:"TenantID,omitempty"` + + // Type + Type string `json:"Type,omitempty"` + + // Zone + Zone string `json:"Zone,omitempty"` +} + +// Validate validates this cluster +func (m *Cluster) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this cluster based on context it is used +func (m *Cluster) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Cluster) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Cluster) UnmarshalBinary(b []byte) error { + var res Cluster + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/cluster_request.go b/api/devops/devops_models/cluster_request.go new file mode 100644 index 0000000..a0f4399 --- /dev/null +++ b/api/devops/devops_models/cluster_request.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ClusterRequest cluster request +// +// swagger:model ClusterRequest +type ClusterRequest struct { + + // data + Data []*Cluster `json:"Data"` +} + +// Validate validates this cluster request +func (m *ClusterRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ClusterRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this cluster request based on the context it is used +func (m *ClusterRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ClusterRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ClusterRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ClusterRequest) UnmarshalBinary(b []byte) error { + var res ClusterRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/cluster_response.go b/api/devops/devops_models/cluster_response.go new file mode 100644 index 0000000..4a2284c --- /dev/null +++ b/api/devops/devops_models/cluster_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ClusterResponse An array of cluster objects +// +// swagger:model ClusterResponse +type ClusterResponse struct { + + // data + Data []*Cluster `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this cluster response +func (m *ClusterResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ClusterResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ClusterResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this cluster response based on the context it is used +func (m *ClusterResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ClusterResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ClusterResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ClusterResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ClusterResponse) UnmarshalBinary(b []byte) error { + var res ClusterResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/database.go b/api/devops/devops_models/database.go new file mode 100644 index 0000000..09be23b --- /dev/null +++ b/api/devops/devops_models/database.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_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" +) + +// Database A Database provisioned and owned by a Tenant +// +// swagger:model Database +type Database struct { + + // Is this database active? + Active bool `json:"Active,omitempty"` + + // The ID of the Cluster in which this database is deployed + ClusterID string `json:"ClusterID,omitempty"` + + // Created By + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Database connection string + DSN string `json:"DSN,omitempty"` + + // The name of the physical database in the cluster + DatabaseName string `json:"DatabaseName,omitempty"` + + // Record Id + ID string `json:"ID,omitempty"` + + // Last Modified By + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modifed Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // List of Telnexus microservices implemented by this Database + Microservices string `json:"Microservices,omitempty"` + + // The current status of this Tenant + Status string `json:"Status,omitempty"` + + // The ID of the tenant who owns this Database + TenantID string `json:"TenantID,omitempty"` + + // The type of Database (mysql, etc) + Type string `json:"Type,omitempty"` +} + +// Validate validates this database +func (m *Database) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this database based on context it is used +func (m *Database) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Database) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Database) UnmarshalBinary(b []byte) error { + var res Database + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/database_request.go b/api/devops/devops_models/database_request.go new file mode 100644 index 0000000..12a47b9 --- /dev/null +++ b/api/devops/devops_models/database_request.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DatabaseRequest An array of Database objects +// +// swagger:model DatabaseRequest +type DatabaseRequest struct { + + // data + Data []*Database `json:"Data"` +} + +// Validate validates this database request +func (m *DatabaseRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DatabaseRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this database request based on the context it is used +func (m *DatabaseRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DatabaseRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DatabaseRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DatabaseRequest) UnmarshalBinary(b []byte) error { + var res DatabaseRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/database_response.go b/api/devops/devops_models/database_response.go new file mode 100644 index 0000000..51ed0b9 --- /dev/null +++ b/api/devops/devops_models/database_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DatabaseResponse An array of Database objects +// +// swagger:model DatabaseResponse +type DatabaseResponse struct { + + // data + Data []*Database `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this database response +func (m *DatabaseResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DatabaseResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DatabaseResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this database response based on the context it is used +func (m *DatabaseResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DatabaseResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DatabaseResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DatabaseResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DatabaseResponse) UnmarshalBinary(b []byte) error { + var res DatabaseResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/delete_response.go b/api/devops/devops_models/delete_response.go new file mode 100644 index 0000000..5625e3c --- /dev/null +++ b/api/devops/devops_models/delete_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DeleteResponse delete response +// +// swagger:model DeleteResponse +type DeleteResponse struct { + + // data + Data []*Message `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this delete response +func (m *DeleteResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeleteResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DeleteResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this delete response based on the context it is used +func (m *DeleteResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeleteResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DeleteResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeleteResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeleteResponse) UnmarshalBinary(b []byte) error { + var res DeleteResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/error.go b/api/devops/devops_models/error.go new file mode 100644 index 0000000..3db3500 --- /dev/null +++ b/api/devops/devops_models/error.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_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" +) + +// Error error +// +// swagger:model Error +type Error struct { + + // code + Code int64 `json:"code,omitempty"` + + // fields + Fields string `json:"fields,omitempty"` + + // message + Message string `json:"message,omitempty"` +} + +// Validate validates this error +func (m *Error) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this error based on context it is used +func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Error) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Error) UnmarshalBinary(b []byte) error { + var res Error + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/ingest.go b/api/devops/devops_models/ingest.go new file mode 100644 index 0000000..666a449 --- /dev/null +++ b/api/devops/devops_models/ingest.go @@ -0,0 +1,446 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_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" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Ingest A record of the Ingest of information into Telnexus +// +// swagger:model Ingest +type Ingest struct { + + // Account ID + // Required: true + AccountID *string `json:"AccountID"` + + // Rollup Tax Amount + Amount float64 `json:"Amount,omitempty"` + + // Backend ID + BackendID string `json:"BackendID,omitempty"` + + // Company ID + CompanyID string `json:"CompanyID,omitempty"` + + // Telnexus User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Date of Job Creation + CreatedDate string `json:"CreatedDate,omitempty"` + + // Ingest Description + Description string `json:"Description,omitempty"` + + // End Date + EndDate string `json:"EndDate,omitempty"` + + // Filename + Filename string `json:"Filename,omitempty"` + + // Record Id + ID string `json:"ID,omitempty"` + + // Ingest Date + IngestDate string `json:"IngestDate,omitempty"` + + // Ingest Failure Reason + IngestFailureReason string `json:"IngestFailureReason,omitempty"` + + // Ingest Type + // Enum: [fabric internal suretax taxnexus-api] + IngestType string `json:"IngestType,omitempty"` + + // Invoice Count + InvoiceCount int64 `json:"InvoiceCount,omitempty"` + + // Job ID + JobID string `json:"JobID,omitempty"` + + // Telnexus User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // metrc last modified end + MetrcLastModifiedEnd string `json:"MetrcLastModifiedEnd,omitempty"` + + // metrc last modified start + MetrcLastModifiedStart string `json:"MetrcLastModifiedStart,omitempty"` + + // License + MetrcLicense string `json:"MetrcLicense,omitempty"` + + // metrc salesreceipt ID + MetrcSalesreceiptID int64 `json:"MetrcSalesreceiptID,omitempty"` + + // State Code + MetrcState string `json:"MetrcState,omitempty"` + + // Ingest Object Type + // Required: true + // Enum: [account cash-receipt contact invoice order po quote] + ObjectType *string `json:"ObjectType"` + + // PO Count + POCount int64 `json:"POCount,omitempty"` + + // Parent Foreign Key + ParentFK string `json:"ParentFK,omitempty"` + + // Period ID + PeriodID string `json:"PeriodID,omitempty"` + + // Post Failure Reason + PostFalureReason string `json:"PostFalureReason,omitempty"` + + // Rating Engine ID + RatingEngineID string `json:"RatingEngineID,omitempty"` + + // Source System Reference + Ref string `json:"Ref,omitempty"` + + // Rollup Revenue Base + RevenueBase float64 `json:"RevenueBase,omitempty"` + + // Rollup Revenue Net + RevenueNet float64 `json:"RevenueNet,omitempty"` + + // Rollup Revenue Not Taxable + RevenueNotTaxable float64 `json:"RevenueNotTaxable,omitempty"` + + // The Saga ID used to link log entries and transactions + SagaID string `json:"SagaID,omitempty"` + + // The type of Saga transaction being performed + SagaType string `json:"SagaType,omitempty"` + + // The source system that generated this job + // Enum: [api fabric taxnexus telnexus] + Source string `json:"Source,omitempty"` + + // Start Date + StartDate string `json:"StartDate,omitempty"` + + // Ingest Status + // Enum: [failed_accounting failed_existing failed_glpost failed_invoice failed_po ingested new posted queued rated rejected] + Status string `json:"Status,omitempty"` + + // Rollup Tax + Tax float64 `json:"Tax,omitempty"` + + // Rollup Tax On Tax + TaxOnTax float64 `json:"TaxOnTax,omitempty"` + + // Tax Transaction Count + TaxTransactionCount int64 `json:"TaxTransactionCount,omitempty"` + + // Template + TemplateID string `json:"TemplateID,omitempty"` + + // ID of the Tenant that owns this Object Instance + TenantID string `json:"TenantID,omitempty"` + + // Rollup Unit Base + UnitBase int64 `json:"UnitBase,omitempty"` +} + +// Validate validates this ingest +func (m *Ingest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAccountID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIngestType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateObjectType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSource(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Ingest) validateAccountID(formats strfmt.Registry) error { + + if err := validate.Required("AccountID", "body", m.AccountID); err != nil { + return err + } + + return nil +} + +var ingestTypeIngestTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["fabric","internal","suretax","taxnexus-api"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + ingestTypeIngestTypePropEnum = append(ingestTypeIngestTypePropEnum, v) + } +} + +const ( + + // IngestIngestTypeFabric captures enum value "fabric" + IngestIngestTypeFabric string = "fabric" + + // IngestIngestTypeInternal captures enum value "internal" + IngestIngestTypeInternal string = "internal" + + // IngestIngestTypeSuretax captures enum value "suretax" + IngestIngestTypeSuretax string = "suretax" + + // IngestIngestTypeTaxnexusDashAPI captures enum value "taxnexus-api" + IngestIngestTypeTaxnexusDashAPI string = "taxnexus-api" +) + +// prop value enum +func (m *Ingest) validateIngestTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, ingestTypeIngestTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Ingest) validateIngestType(formats strfmt.Registry) error { + if swag.IsZero(m.IngestType) { // not required + return nil + } + + // value enum + if err := m.validateIngestTypeEnum("IngestType", "body", m.IngestType); err != nil { + return err + } + + return nil +} + +var ingestTypeObjectTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["account","cash-receipt","contact","invoice","order","po","quote"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + ingestTypeObjectTypePropEnum = append(ingestTypeObjectTypePropEnum, v) + } +} + +const ( + + // IngestObjectTypeAccount captures enum value "account" + IngestObjectTypeAccount string = "account" + + // IngestObjectTypeCashDashReceipt captures enum value "cash-receipt" + IngestObjectTypeCashDashReceipt string = "cash-receipt" + + // IngestObjectTypeContact captures enum value "contact" + IngestObjectTypeContact string = "contact" + + // IngestObjectTypeInvoice captures enum value "invoice" + IngestObjectTypeInvoice string = "invoice" + + // IngestObjectTypeOrder captures enum value "order" + IngestObjectTypeOrder string = "order" + + // IngestObjectTypePo captures enum value "po" + IngestObjectTypePo string = "po" + + // IngestObjectTypeQuote captures enum value "quote" + IngestObjectTypeQuote string = "quote" +) + +// prop value enum +func (m *Ingest) validateObjectTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, ingestTypeObjectTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Ingest) validateObjectType(formats strfmt.Registry) error { + + if err := validate.Required("ObjectType", "body", m.ObjectType); err != nil { + return err + } + + // value enum + if err := m.validateObjectTypeEnum("ObjectType", "body", *m.ObjectType); err != nil { + return err + } + + return nil +} + +var ingestTypeSourcePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["api","fabric","taxnexus","telnexus"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + ingestTypeSourcePropEnum = append(ingestTypeSourcePropEnum, v) + } +} + +const ( + + // IngestSourceAPI captures enum value "api" + IngestSourceAPI string = "api" + + // IngestSourceFabric captures enum value "fabric" + IngestSourceFabric string = "fabric" + + // IngestSourceTaxnexus captures enum value "taxnexus" + IngestSourceTaxnexus string = "taxnexus" + + // IngestSourceTelnexus captures enum value "telnexus" + IngestSourceTelnexus string = "telnexus" +) + +// prop value enum +func (m *Ingest) validateSourceEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, ingestTypeSourcePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Ingest) validateSource(formats strfmt.Registry) error { + if swag.IsZero(m.Source) { // not required + return nil + } + + // value enum + if err := m.validateSourceEnum("Source", "body", m.Source); err != nil { + return err + } + + return nil +} + +var ingestTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["failed_accounting","failed_existing","failed_glpost","failed_invoice","failed_po","ingested","new","posted","queued","rated","rejected"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + ingestTypeStatusPropEnum = append(ingestTypeStatusPropEnum, v) + } +} + +const ( + + // IngestStatusFailedAccounting captures enum value "failed_accounting" + IngestStatusFailedAccounting string = "failed_accounting" + + // IngestStatusFailedExisting captures enum value "failed_existing" + IngestStatusFailedExisting string = "failed_existing" + + // IngestStatusFailedGlpost captures enum value "failed_glpost" + IngestStatusFailedGlpost string = "failed_glpost" + + // IngestStatusFailedInvoice captures enum value "failed_invoice" + IngestStatusFailedInvoice string = "failed_invoice" + + // IngestStatusFailedPo captures enum value "failed_po" + IngestStatusFailedPo string = "failed_po" + + // IngestStatusIngested captures enum value "ingested" + IngestStatusIngested string = "ingested" + + // IngestStatusNew captures enum value "new" + IngestStatusNew string = "new" + + // IngestStatusPosted captures enum value "posted" + IngestStatusPosted string = "posted" + + // IngestStatusQueued captures enum value "queued" + IngestStatusQueued string = "queued" + + // IngestStatusRated captures enum value "rated" + IngestStatusRated string = "rated" + + // IngestStatusRejected captures enum value "rejected" + IngestStatusRejected string = "rejected" +) + +// prop value enum +func (m *Ingest) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, ingestTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Ingest) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("Status", "body", m.Status); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this ingest based on context it is used +func (m *Ingest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Ingest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Ingest) UnmarshalBinary(b []byte) error { + var res Ingest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/ingest_request.go b/api/devops/devops_models/ingest_request.go new file mode 100644 index 0000000..11276a5 --- /dev/null +++ b/api/devops/devops_models/ingest_request.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// IngestRequest ingest request +// +// swagger:model IngestRequest +type IngestRequest struct { + + // data + Data []*Ingest `json:"Data"` +} + +// Validate validates this ingest request +func (m *IngestRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IngestRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this ingest request based on the context it is used +func (m *IngestRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IngestRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IngestRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IngestRequest) UnmarshalBinary(b []byte) error { + var res IngestRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/ingest_response.go b/api/devops/devops_models/ingest_response.go new file mode 100644 index 0000000..1a3880a --- /dev/null +++ b/api/devops/devops_models/ingest_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// IngestResponse An array of Print-Ready ingest Objects +// +// swagger:model IngestResponse +type IngestResponse struct { + + // data + Data []*Ingest `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this ingest response +func (m *IngestResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IngestResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *IngestResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this ingest response based on the context it is used +func (m *IngestResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IngestResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *IngestResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IngestResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IngestResponse) UnmarshalBinary(b []byte) error { + var res IngestResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/job.go b/api/devops/devops_models/job.go new file mode 100644 index 0000000..42330a2 --- /dev/null +++ b/api/devops/devops_models/job.go @@ -0,0 +1,486 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_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" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Job job +// +// swagger:model Job +type Job struct { + + // Telnexus Account Id + // Required: true + AccountID *string `json:"AccountID"` + + // Telnexus Backend ID + BackendID string `json:"BackendID,omitempty"` + + // Telnexus Company ID + CompanyID string `json:"CompanyID,omitempty"` + + // Telnexus Coordinate ID + CoordinateID string `json:"CoordinateID,omitempty"` + + // Telnexus User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Date of Job Creation + CreatedDate string `json:"CreatedDate,omitempty"` + + // The amount of time after the Start Time to perform one or more jobs + // Required: true + // Enum: [day document hour minute month quarter second week year] + Duration *string `json:"Duration"` + + // End Date/Time + EndDate string `json:"EndDate,omitempty"` + + // Error Reason + ErrorReason string `json:"ErrorReason,omitempty"` + + // Telnexus Record Id of the Job record + ID string `json:"ID,omitempty"` + + // The time interval by which multiple jobs are executed within the Duration + // Enum: [day each hour minute month quarter second week year] + Interval string `json:"Interval,omitempty"` + + // Job Date + JobDate string `json:"JobDate,omitempty"` + + // Last Modified By + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // The Month Number of the job + Month int64 `json:"Month,omitempty"` + + // Next Job + NextJobID string `json:"NextJobID,omitempty"` + + // The user ID that owns this job + OwnerID string `json:"OwnerID,omitempty"` + + // The parameters needed to process the job + Parameters string `json:"Parameters,omitempty"` + + // Period + PeriodID string `json:"PeriodID,omitempty"` + + // The Month Number of the job + Quarter int64 `json:"Quarter,omitempty"` + + // Rating Engine + RatingEngineID string `json:"RatingEngineID,omitempty"` + + // External Reference + Ref string `json:"Ref,omitempty"` + + // Reschedule? + Reschedule bool `json:"Reschedule,omitempty"` + + // Reschedule Interval + RescheduleInterval int64 `json:"RescheduleInterval,omitempty"` + + // The Saga ID used to link log entries and transactions + SagaID string `json:"SagaID,omitempty"` + + // The type of Saga transaction being performed + // Required: true + SagaType *string `json:"SagaType"` + + // The Month Number of the job + Semiannual int64 `json:"Semiannual,omitempty"` + + // The source system that generated this job + // Enum: [api fabric taxnexus telnexus] + Source string `json:"Source,omitempty"` + + // Start Date/Time + StartDate string `json:"StartDate,omitempty"` + + // Status + // Enum: [active complete error new queued] + Status string `json:"Status,omitempty"` + + // The target system that executes this job + // Enum: [api fabric taxnexus telnexus] + Target string `json:"Target,omitempty"` + + // ID of the Tenant that owns this Object Instance + TenantID string `json:"TenantID,omitempty"` + + // The Month Number of the job + Year int64 `json:"Year,omitempty"` +} + +// Validate validates this job +func (m *Job) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAccountID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDuration(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInterval(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSagaType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSource(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTarget(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Job) validateAccountID(formats strfmt.Registry) error { + + if err := validate.Required("AccountID", "body", m.AccountID); err != nil { + return err + } + + return nil +} + +var jobTypeDurationPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["day","document","hour","minute","month","quarter","second","week","year"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + jobTypeDurationPropEnum = append(jobTypeDurationPropEnum, v) + } +} + +const ( + + // JobDurationDay captures enum value "day" + JobDurationDay string = "day" + + // JobDurationDocument captures enum value "document" + JobDurationDocument string = "document" + + // JobDurationHour captures enum value "hour" + JobDurationHour string = "hour" + + // JobDurationMinute captures enum value "minute" + JobDurationMinute string = "minute" + + // JobDurationMonth captures enum value "month" + JobDurationMonth string = "month" + + // JobDurationQuarter captures enum value "quarter" + JobDurationQuarter string = "quarter" + + // JobDurationSecond captures enum value "second" + JobDurationSecond string = "second" + + // JobDurationWeek captures enum value "week" + JobDurationWeek string = "week" + + // JobDurationYear captures enum value "year" + JobDurationYear string = "year" +) + +// prop value enum +func (m *Job) validateDurationEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, jobTypeDurationPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Job) validateDuration(formats strfmt.Registry) error { + + if err := validate.Required("Duration", "body", m.Duration); err != nil { + return err + } + + // value enum + if err := m.validateDurationEnum("Duration", "body", *m.Duration); err != nil { + return err + } + + return nil +} + +var jobTypeIntervalPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["day","each","hour","minute","month","quarter","second","week","year"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + jobTypeIntervalPropEnum = append(jobTypeIntervalPropEnum, v) + } +} + +const ( + + // JobIntervalDay captures enum value "day" + JobIntervalDay string = "day" + + // JobIntervalEach captures enum value "each" + JobIntervalEach string = "each" + + // JobIntervalHour captures enum value "hour" + JobIntervalHour string = "hour" + + // JobIntervalMinute captures enum value "minute" + JobIntervalMinute string = "minute" + + // JobIntervalMonth captures enum value "month" + JobIntervalMonth string = "month" + + // JobIntervalQuarter captures enum value "quarter" + JobIntervalQuarter string = "quarter" + + // JobIntervalSecond captures enum value "second" + JobIntervalSecond string = "second" + + // JobIntervalWeek captures enum value "week" + JobIntervalWeek string = "week" + + // JobIntervalYear captures enum value "year" + JobIntervalYear string = "year" +) + +// prop value enum +func (m *Job) validateIntervalEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, jobTypeIntervalPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Job) validateInterval(formats strfmt.Registry) error { + if swag.IsZero(m.Interval) { // not required + return nil + } + + // value enum + if err := m.validateIntervalEnum("Interval", "body", m.Interval); err != nil { + return err + } + + return nil +} + +func (m *Job) validateSagaType(formats strfmt.Registry) error { + + if err := validate.Required("SagaType", "body", m.SagaType); err != nil { + return err + } + + return nil +} + +var jobTypeSourcePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["api","fabric","taxnexus","telnexus"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + jobTypeSourcePropEnum = append(jobTypeSourcePropEnum, v) + } +} + +const ( + + // JobSourceAPI captures enum value "api" + JobSourceAPI string = "api" + + // JobSourceFabric captures enum value "fabric" + JobSourceFabric string = "fabric" + + // JobSourceTaxnexus captures enum value "taxnexus" + JobSourceTaxnexus string = "taxnexus" + + // JobSourceTelnexus captures enum value "telnexus" + JobSourceTelnexus string = "telnexus" +) + +// prop value enum +func (m *Job) validateSourceEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, jobTypeSourcePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Job) validateSource(formats strfmt.Registry) error { + if swag.IsZero(m.Source) { // not required + return nil + } + + // value enum + if err := m.validateSourceEnum("Source", "body", m.Source); err != nil { + return err + } + + return nil +} + +var jobTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["active","complete","error","new","queued"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + jobTypeStatusPropEnum = append(jobTypeStatusPropEnum, v) + } +} + +const ( + + // JobStatusActive captures enum value "active" + JobStatusActive string = "active" + + // JobStatusComplete captures enum value "complete" + JobStatusComplete string = "complete" + + // JobStatusError captures enum value "error" + JobStatusError string = "error" + + // JobStatusNew captures enum value "new" + JobStatusNew string = "new" + + // JobStatusQueued captures enum value "queued" + JobStatusQueued string = "queued" +) + +// prop value enum +func (m *Job) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, jobTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Job) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("Status", "body", m.Status); err != nil { + return err + } + + return nil +} + +var jobTypeTargetPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["api","fabric","taxnexus","telnexus"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + jobTypeTargetPropEnum = append(jobTypeTargetPropEnum, v) + } +} + +const ( + + // JobTargetAPI captures enum value "api" + JobTargetAPI string = "api" + + // JobTargetFabric captures enum value "fabric" + JobTargetFabric string = "fabric" + + // JobTargetTaxnexus captures enum value "taxnexus" + JobTargetTaxnexus string = "taxnexus" + + // JobTargetTelnexus captures enum value "telnexus" + JobTargetTelnexus string = "telnexus" +) + +// prop value enum +func (m *Job) validateTargetEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, jobTypeTargetPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Job) validateTarget(formats strfmt.Registry) error { + if swag.IsZero(m.Target) { // not required + return nil + } + + // value enum + if err := m.validateTargetEnum("Target", "body", m.Target); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this job based on context it is used +func (m *Job) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Job) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Job) UnmarshalBinary(b []byte) error { + var res Job + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/job_request.go b/api/devops/devops_models/job_request.go new file mode 100644 index 0000000..dd27179 --- /dev/null +++ b/api/devops/devops_models/job_request.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// JobRequest job request +// +// swagger:model JobRequest +type JobRequest struct { + + // data + Data []*Job `json:"Data"` +} + +// Validate validates this job request +func (m *JobRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *JobRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this job request based on the context it is used +func (m *JobRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *JobRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *JobRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *JobRequest) UnmarshalBinary(b []byte) error { + var res JobRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/job_response.go b/api/devops/devops_models/job_response.go new file mode 100644 index 0000000..9d2f64c --- /dev/null +++ b/api/devops/devops_models/job_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// JobResponse An array of Job Objects +// +// swagger:model JobResponse +type JobResponse struct { + + // data + Data []*Job `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this job response +func (m *JobResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *JobResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *JobResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this job response based on the context it is used +func (m *JobResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *JobResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *JobResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *JobResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *JobResponse) UnmarshalBinary(b []byte) error { + var res JobResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/message.go b/api/devops/devops_models/message.go new file mode 100644 index 0000000..5dfa00c --- /dev/null +++ b/api/devops/devops_models/message.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_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" +) + +// Message message +// +// swagger:model Message +type Message struct { + + // message + Message string `json:"Message,omitempty"` + + // ref + Ref string `json:"Ref,omitempty"` + + // status + Status int64 `json:"Status,omitempty"` +} + +// Validate validates this message +func (m *Message) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this message based on context it is used +func (m *Message) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Message) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Message) UnmarshalBinary(b []byte) error { + var res Message + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/pagination.go b/api/devops/devops_models/pagination.go new file mode 100644 index 0000000..ffdea03 --- /dev/null +++ b/api/devops/devops_models/pagination.go @@ -0,0 +1,63 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_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" +) + +// Pagination pagination +// +// swagger:model Pagination +type Pagination struct { + + // limit + Limit int64 `json:"Limit,omitempty"` + + // p offset + POffset int64 `json:"POffset,omitempty"` + + // page size + PageSize int64 `json:"PageSize,omitempty"` + + // set size + SetSize int64 `json:"SetSize,omitempty"` +} + +// Validate validates this pagination +func (m *Pagination) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this pagination based on context it is used +func (m *Pagination) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Pagination) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Pagination) UnmarshalBinary(b []byte) error { + var res Pagination + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/request_meta.go b/api/devops/devops_models/request_meta.go new file mode 100644 index 0000000..8dd7155 --- /dev/null +++ b/api/devops/devops_models/request_meta.go @@ -0,0 +1,75 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RequestMeta request meta +// +// swagger:model RequestMeta +type RequestMeta struct { + + // Telnexus Account Number of the Reseller or OEM + // Required: true + TelnexusAccount *string `json:"TelnexusAccount"` +} + +// Validate validates this request meta +func (m *RequestMeta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTelnexusAccount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RequestMeta) validateTelnexusAccount(formats strfmt.Registry) error { + + if err := validate.Required("TelnexusAccount", "body", m.TelnexusAccount); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this request meta based on context it is used +func (m *RequestMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RequestMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RequestMeta) UnmarshalBinary(b []byte) error { + var res RequestMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/response_meta.go b/api/devops/devops_models/response_meta.go new file mode 100644 index 0000000..afc77d3 --- /dev/null +++ b/api/devops/devops_models/response_meta.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_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" +) + +// ResponseMeta response meta +// +// swagger:model ResponseMeta +type ResponseMeta struct { + + // Microservice Contact Info + Contact string `json:"Contact,omitempty"` + + // Copyright Info + Copyright string `json:"Copyright,omitempty"` + + // License Information and Restrictions + License string `json:"License,omitempty"` + + // Operation ID + OperationID string `json:"OperationID,omitempty"` + + // pagination + Pagination *Pagination `json:"Pagination,omitempty"` + + // Request IP Address + RequestIP string `json:"RequestIP,omitempty"` + + // Request Type + RequestType string `json:"RequestType,omitempty"` + + // Request URL + RequestURL string `json:"RequestURL,omitempty"` + + // Data Server Info + ServerInfo string `json:"ServerInfo,omitempty"` + + // Data Server Response Time (ms) + ServerResponseTime string `json:"ServerResponseTime,omitempty"` + + // Backend Server Timestamp + ServerTimestamp string `json:"ServerTimestamp,omitempty"` + + // Telnexus Account Number used for recording transactions + TelnexusAccount string `json:"TelnexusAccount,omitempty"` +} + +// Validate validates this response meta +func (m *ResponseMeta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePagination(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ResponseMeta) validatePagination(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Pagination") + } + return err + } + } + + return nil +} + +// ContextValidate validate this response meta based on the context it is used +func (m *ResponseMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePagination(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ResponseMeta) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { + + if m.Pagination != nil { + if err := m.Pagination.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Pagination") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ResponseMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ResponseMeta) UnmarshalBinary(b []byte) error { + var res ResponseMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/role.go b/api/devops/devops_models/role.go new file mode 100644 index 0000000..88473fc --- /dev/null +++ b/api/devops/devops_models/role.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_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" +) + +// Role A functional role within a Tenant +// +// swagger:model Role +type Role struct { + + // The corresponding Auth0 Role + Auth0RoleID string `json:"Auth0RoleID,omitempty"` + + // Created By + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Role Description + Description string `json:"Description,omitempty"` + + // Record Id + ID string `json:"ID,omitempty"` + + // Last Modified By + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modifed Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // The name of this role + RoleName string `json:"RoleName,omitempty"` + + // The ID of the Tenant that owns this Role + TenantID string `json:"TenantID,omitempty"` +} + +// Validate validates this role +func (m *Role) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this role based on context it is used +func (m *Role) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Role) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Role) UnmarshalBinary(b []byte) error { + var res Role + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/role_request.go b/api/devops/devops_models/role_request.go new file mode 100644 index 0000000..0c8e6d9 --- /dev/null +++ b/api/devops/devops_models/role_request.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RoleRequest An array of Role objects +// +// swagger:model RoleRequest +type RoleRequest struct { + + // date + Date []*Role `json:"Date"` +} + +// Validate validates this role request +func (m *RoleRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RoleRequest) validateDate(formats strfmt.Registry) error { + if swag.IsZero(m.Date) { // not required + return nil + } + + for i := 0; i < len(m.Date); i++ { + if swag.IsZero(m.Date[i]) { // not required + continue + } + + if m.Date[i] != nil { + if err := m.Date[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Date" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this role request based on the context it is used +func (m *RoleRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDate(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RoleRequest) contextValidateDate(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Date); i++ { + + if m.Date[i] != nil { + if err := m.Date[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Date" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RoleRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RoleRequest) UnmarshalBinary(b []byte) error { + var res RoleRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/role_response.go b/api/devops/devops_models/role_response.go new file mode 100644 index 0000000..44375ee --- /dev/null +++ b/api/devops/devops_models/role_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RoleResponse An array of Role objects +// +// swagger:model RoleResponse +type RoleResponse struct { + + // data + Data []*Role `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this role response +func (m *RoleResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RoleResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *RoleResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this role response based on the context it is used +func (m *RoleResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RoleResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *RoleResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RoleResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RoleResponse) UnmarshalBinary(b []byte) error { + var res RoleResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/service.go b/api/devops/devops_models/service.go new file mode 100644 index 0000000..7c49597 --- /dev/null +++ b/api/devops/devops_models/service.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_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" +) + +// Service service +// +// swagger:model Service +type Service struct { + + // Active? + Active bool `json:"Active,omitempty"` + + // Cluster + ClusterID string `json:"ClusterID,omitempty"` + + // Cluster IP + ClusterIP string `json:"ClusterIP,omitempty"` + + // Cluster URL + ClusterURL string `json:"ClusterURL,omitempty"` + + // Created By + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Environment + Environment string `json:"Environment,omitempty"` + + // External URL + ExternalURL string `json:"ExternalURL,omitempty"` + + // GELF Address + GELFAddress string `json:"GELFAddress,omitempty"` + + // Telnexus Record Id + ID string `json:"ID,omitempty"` + + // Last Modified By + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Network Alias + NetworkAlias string `json:"NetworkAlias,omitempty"` + + // OpenAPI Version + OpenAPIVersion string `json:"OpenAPIVersion,omitempty"` + + // Owner + OwnerID string `json:"OwnerID,omitempty"` + + // Port - External + PortExternal string `json:"PortExternal,omitempty"` + + // Port - Test + PortTest string `json:"PortTest,omitempty"` + + // Proxy Type + ProxyType string `json:"ProxyType,omitempty"` + + // Replicas + Replicas int64 `json:"Replicas,omitempty"` + + // Repo URL + RepoURL string `json:"RepoURL,omitempty"` + + // Service Name + ServiceName string `json:"ServiceName,omitempty"` + + // The ID of the tenant who owns this Database + TenantID string `json:"TenantID,omitempty"` + + // Version + Version string `json:"Version,omitempty"` +} + +// Validate validates this service +func (m *Service) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this service based on context it is used +func (m *Service) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Service) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Service) UnmarshalBinary(b []byte) error { + var res Service + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/service_request.go b/api/devops/devops_models/service_request.go new file mode 100644 index 0000000..e127613 --- /dev/null +++ b/api/devops/devops_models/service_request.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ServiceRequest service request +// +// swagger:model ServiceRequest +type ServiceRequest struct { + + // data + Data []*Service `json:"Data"` +} + +// Validate validates this service request +func (m *ServiceRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this service request based on the context it is used +func (m *ServiceRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ServiceRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ServiceRequest) UnmarshalBinary(b []byte) error { + var res ServiceRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/service_response.go b/api/devops/devops_models/service_response.go new file mode 100644 index 0000000..20b99ca --- /dev/null +++ b/api/devops/devops_models/service_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ServiceResponse An array of Service Objects +// +// swagger:model ServiceResponse +type ServiceResponse struct { + + // data + Data []*Service `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this service response +func (m *ServiceResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ServiceResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this service response based on the context it is used +func (m *ServiceResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ServiceResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ServiceResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ServiceResponse) UnmarshalBinary(b []byte) error { + var res ServiceResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/template.go b/api/devops/devops_models/template.go new file mode 100644 index 0000000..6631f28 --- /dev/null +++ b/api/devops/devops_models/template.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_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" +) + +// Template template +// +// swagger:model Template +type Template struct { + + // Company + CompanyID string `json:"CompanyID,omitempty"` + + // created by ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // created date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // HTML Body + // Format: byte + HTML strfmt.Base64 `json:"HTML,omitempty"` + + // Telnexus Record Id + ID string `json:"ID,omitempty"` + + // Active? + IsActive bool `json:"IsActive,omitempty"` + + // Master Template? + IsMaster bool `json:"IsMaster,omitempty"` + + // last modified by ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // last modified date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Template Name + Name string `json:"Name,omitempty"` + + // Object + ObjectType string `json:"ObjectType,omitempty"` + + // Record Type Name + RecordTypeName string `json:"RecordTypeName,omitempty"` + + // Tenant that owns this object instance + TenantID string `json:"TenantID,omitempty"` + + // Type + Type string `json:"Type,omitempty"` + + // URL + URL string `json:"URL,omitempty"` +} + +// Validate validates this template +func (m *Template) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this template based on context it is used +func (m *Template) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Template) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Template) UnmarshalBinary(b []byte) error { + var res Template + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/template_request.go b/api/devops/devops_models/template_request.go new file mode 100644 index 0000000..16854c8 --- /dev/null +++ b/api/devops/devops_models/template_request.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TemplateRequest An array of Templates +// +// swagger:model TemplateRequest +type TemplateRequest struct { + + // data + Data []*Template `json:"Data"` +} + +// Validate validates this template request +func (m *TemplateRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TemplateRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this template request based on the context it is used +func (m *TemplateRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TemplateRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TemplateRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TemplateRequest) UnmarshalBinary(b []byte) error { + var res TemplateRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/template_response.go b/api/devops/devops_models/template_response.go new file mode 100644 index 0000000..243418a --- /dev/null +++ b/api/devops/devops_models/template_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TemplateResponse An array of Templates +// +// swagger:model TemplateResponse +type TemplateResponse struct { + + // data + Data []*Template `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this template response +func (m *TemplateResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TemplateResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TemplateResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this template response based on the context it is used +func (m *TemplateResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TemplateResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TemplateResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TemplateResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TemplateResponse) UnmarshalBinary(b []byte) error { + var res TemplateResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/tenant.go b/api/devops/devops_models/tenant.go new file mode 100644 index 0000000..affccb5 --- /dev/null +++ b/api/devops/devops_models/tenant.go @@ -0,0 +1,255 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Tenant Telnexus Account Tenant +// +// swagger:model Tenant +type Tenant struct { + + // The Account that owns this Tenant + AccountID string `json:"AccountID,omitempty"` + + // Is this Tenant currently active? + Active bool `json:"Active,omitempty"` + + // Created By + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // databases + Databases []*Database `json:"Databases"` + + // Record Id + ID string `json:"ID,omitempty"` + + // Last Modified By + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modifed Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // roles + Roles []*Role `json:"Roles"` + + // The current status of this Tenant + Status string `json:"Status,omitempty"` + + // Name of the Tenant Resource + TenantName string `json:"TenantName,omitempty"` + + // tenant users + TenantUsers []*TenantUser `json:"TenantUsers"` + + // The type of Tenant + Type string `json:"Type,omitempty"` + + // The version number of the Tenant Onboarding system used to create this tenant + Version string `json:"Version,omitempty"` +} + +// Validate validates this tenant +func (m *Tenant) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDatabases(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRoles(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTenantUsers(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Tenant) validateDatabases(formats strfmt.Registry) error { + if swag.IsZero(m.Databases) { // not required + return nil + } + + for i := 0; i < len(m.Databases); i++ { + if swag.IsZero(m.Databases[i]) { // not required + continue + } + + if m.Databases[i] != nil { + if err := m.Databases[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Databases" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Tenant) validateRoles(formats strfmt.Registry) error { + if swag.IsZero(m.Roles) { // not required + return nil + } + + for i := 0; i < len(m.Roles); i++ { + if swag.IsZero(m.Roles[i]) { // not required + continue + } + + if m.Roles[i] != nil { + if err := m.Roles[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Roles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Tenant) validateTenantUsers(formats strfmt.Registry) error { + if swag.IsZero(m.TenantUsers) { // not required + return nil + } + + for i := 0; i < len(m.TenantUsers); i++ { + if swag.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 { + return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this tenant based on the context it is used +func (m *Tenant) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDatabases(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRoles(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTenantUsers(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Tenant) contextValidateDatabases(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Databases); i++ { + + if m.Databases[i] != nil { + if err := m.Databases[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Databases" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Tenant) contextValidateRoles(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Roles); i++ { + + if m.Roles[i] != nil { + if err := m.Roles[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Roles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Tenant) contextValidateTenantUsers(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TenantUsers); i++ { + + if m.TenantUsers[i] != nil { + if err := m.TenantUsers[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Tenant) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Tenant) UnmarshalBinary(b []byte) error { + var res Tenant + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/tenant_request.go b/api/devops/devops_models/tenant_request.go new file mode 100644 index 0000000..f7caaba --- /dev/null +++ b/api/devops/devops_models/tenant_request.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TenantRequest An array of Tenant objects +// +// swagger:model TenantRequest +type TenantRequest struct { + + // data + Data []*Tenant `json:"Data"` +} + +// Validate validates this tenant request +func (m *TenantRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TenantRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this tenant request based on the context it is used +func (m *TenantRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TenantRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TenantRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TenantRequest) UnmarshalBinary(b []byte) error { + var res TenantRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/tenant_response.go b/api/devops/devops_models/tenant_response.go new file mode 100644 index 0000000..2771efa --- /dev/null +++ b/api/devops/devops_models/tenant_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TenantResponse An array of Tenant objects +// +// swagger:model TenantResponse +type TenantResponse struct { + + // data + Data []*Tenant `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this tenant response +func (m *TenantResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TenantResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TenantResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this tenant response based on the context it is used +func (m *TenantResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TenantResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TenantResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TenantResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TenantResponse) UnmarshalBinary(b []byte) error { + var res TenantResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/tenant_user.go b/api/devops/devops_models/tenant_user.go new file mode 100644 index 0000000..b169a74 --- /dev/null +++ b/api/devops/devops_models/tenant_user.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_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" +) + +// TenantUser Relationship object that connects users to a tenant +// +// swagger:model TenantUser +type TenantUser struct { + + // The makeTenantUser access level for this User + AccessLevel string `json:"AccessLevel,omitempty"` + + // Account ID + AccountID string `json:"AccountID,omitempty"` + + // Auth0 User ID + Auth0UserID string `json:"Auth0UserID,omitempty"` + + // Account Name + CompanyName string `json:"CompanyName,omitempty"` + + // Contact ID + ContactID string `json:"ContactID,omitempty"` + + // Telnexus Account + TelnexusAccount string `json:"TelnexusAccount,omitempty"` + + // Tenant active? + TenantActive bool `json:"TenantActive,omitempty"` + + // The Tenant ID + TenantID string `json:"TenantID,omitempty"` + + // Tenant Name + TenantName string `json:"TenantName,omitempty"` + + // Tenant Status + TenantStatus string `json:"TenantStatus,omitempty"` + + // Tenant type + TenantType string `json:"TenantType,omitempty"` + + // Tenant Version + TenantVersion string `json:"TenantVersion,omitempty"` + + // User Email Address + UserEmail string `json:"UserEmail,omitempty"` + + // User Full Name + UserFullName string `json:"UserFullName,omitempty"` + + // The User ID + UserID string `json:"UserID,omitempty"` + + // Username + Username string `json:"Username,omitempty"` +} + +// Validate validates this tenant user +func (m *TenantUser) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this tenant user based on context it is used +func (m *TenantUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TenantUser) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TenantUser) UnmarshalBinary(b []byte) error { + var res TenantUser + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/user.go b/api/devops/devops_models/user.go new file mode 100644 index 0000000..3edb787 --- /dev/null +++ b/api/devops/devops_models/user.go @@ -0,0 +1,376 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// User user +// +// swagger:model User +type User struct { + + // API Key + APIKey string `json:"APIKey,omitempty"` + + // About Me + AboutMe string `json:"AboutMe,omitempty"` + + // Account ID + AccountID string `json:"AccountID,omitempty"` + + // address + Address *Address `json:"Address,omitempty"` + + // Alias + Alias string `json:"Alias,omitempty"` + + // Auth0 User Id + Auth0UserID string `json:"Auth0UserID,omitempty"` + + // Nickname + CommunityNickname string `json:"CommunityNickname,omitempty"` + + // Company Name + CompanyName string `json:"CompanyName,omitempty"` + + // Contact + ContactID string `json:"ContactID,omitempty"` + + // Created User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Date Created + CreatedDate string `json:"CreatedDate,omitempty"` + + // Delegated Approver + DelegatedApproverID string `json:"DelegatedApproverID,omitempty"` + + // Department + Department string `json:"Department,omitempty"` + + // Division + Division string `json:"Division,omitempty"` + + // Email address + Email string `json:"Email,omitempty"` + + // Employee Number + EmployeeNumber string `json:"EmployeeNumber,omitempty"` + + // Time day ends + EndOfDay string `json:"EndOfDay,omitempty"` + + // Environment + Environment string `json:"Environment,omitempty"` + + // Extension + Extension string `json:"Extension,omitempty"` + + // Fabric API Key + FabricAPIKey string `json:"FabricAPIKey,omitempty"` + + // Fax + Fax string `json:"Fax,omitempty"` + + // The first name + FirstName string `json:"FirstName,omitempty"` + + // Allow Forecasting + ForecastEnabled bool `json:"ForecastEnabled,omitempty"` + + // Full Photo URL + FullPhotoURL string `json:"FullPhotoURL,omitempty"` + + // Telnexus ID + ID string `json:"ID,omitempty"` + + // Active + IsActive bool `json:"IsActive,omitempty"` + + // Is the user enabled for Communities? + IsPortalEnabled bool `json:"IsPortalEnabled,omitempty"` + + // Has Profile Photo + IsProphilePhotoActive bool `json:"IsProphilePhotoActive,omitempty"` + + // is system controlled + IsSystemControlled bool `json:"IsSystemControlled,omitempty"` + + // IP address of last login + LastIP string `json:"LastIP,omitempty"` + + // Last login time + LastLogin string `json:"LastLogin,omitempty"` + + // Last Modified User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // The Last Name + LastName string `json:"LastName,omitempty"` + + // Number of times user has logged in + LoginCount int64 `json:"LoginCount,omitempty"` + + // Manager + ManagerID string `json:"ManagerID,omitempty"` + + // Mobile + MobilePhone string `json:"MobilePhone,omitempty"` + + // Name + Name string `json:"Name,omitempty"` + + // Out of office message + OutOfOfficeMessage string `json:"OutOfOfficeMessage,omitempty"` + + // Phone + Phone string `json:"Phone,omitempty"` + + // Portal Role Level + PortalRole string `json:"PortalRole,omitempty"` + + // Profile + ProfileID string `json:"ProfileID,omitempty"` + + // Info Emails + ReceivesAdminEmails bool `json:"ReceivesAdminEmails,omitempty"` + + // Admin Info Emails + ReceivesAdminInfoEmails bool `json:"ReceivesAdminInfoEmails,omitempty"` + + // Email Sender Address + SenderEmail string `json:"SenderEmail,omitempty"` + + // Email Sender Name + SenderName string `json:"SenderName,omitempty"` + + // Email Signature + Signature string `json:"Signature,omitempty"` + + // Small Photo URL + SmallPhotoURL string `json:"SmallPhotoURL,omitempty"` + + // The time day starts + StartOfDay string `json:"StartOfDay,omitempty"` + + // Telnexus Account + TelnexusAccount string `json:"TelnexusAccount,omitempty"` + + // Tenant ID associated with this user + TenantID string `json:"TenantID,omitempty"` + + // tenant users + TenantUsers []*TenantUser `json:"TenantUsers"` + + // Time Zone + TimeZone string `json:"TimeZone,omitempty"` + + // Title + Title string `json:"Title,omitempty"` + + // Role + UserRoleID string `json:"UserRoleID,omitempty"` + + // user roles + UserRoles []*UserRole `json:"UserRoles"` + + // User Type + UserType string `json:"UserType,omitempty"` + + // Username + Username string `json:"Username,omitempty"` +} + +// Validate validates this user +func (m *User) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTenantUsers(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUserRoles(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *User) validateAddress(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Address") + } + return err + } + } + + return nil +} + +func (m *User) validateTenantUsers(formats strfmt.Registry) error { + if swag.IsZero(m.TenantUsers) { // not required + return nil + } + + for i := 0; i < len(m.TenantUsers); i++ { + if swag.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 { + return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *User) validateUserRoles(formats strfmt.Registry) error { + if swag.IsZero(m.UserRoles) { // not required + return nil + } + + for i := 0; i < len(m.UserRoles); i++ { + if swag.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 { + return ve.ValidateName("UserRoles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this user based on the context it is used +func (m *User) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTenantUsers(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUserRoles(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *User) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.Address != nil { + if err := m.Address.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Address") + } + return err + } + } + + return nil +} + +func (m *User) contextValidateTenantUsers(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TenantUsers); i++ { + + if m.TenantUsers[i] != nil { + if err := m.TenantUsers[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *User) contextValidateUserRoles(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.UserRoles); i++ { + + if m.UserRoles[i] != nil { + if err := m.UserRoles[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("UserRoles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *User) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *User) UnmarshalBinary(b []byte) error { + var res User + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/user_request.go b/api/devops/devops_models/user_request.go new file mode 100644 index 0000000..b243238 --- /dev/null +++ b/api/devops/devops_models/user_request.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UserRequest user request +// +// swagger:model UserRequest +type UserRequest struct { + + // data + Data []*User `json:"Data"` +} + +// Validate validates this user request +func (m *UserRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UserRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this user request based on the context it is used +func (m *UserRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UserRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UserRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UserRequest) UnmarshalBinary(b []byte) error { + var res UserRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/user_response.go b/api/devops/devops_models/user_response.go new file mode 100644 index 0000000..6776d31 --- /dev/null +++ b/api/devops/devops_models/user_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UserResponse An array of Print-Ready ingest Objects +// +// swagger:model UserResponse +type UserResponse struct { + + // data + Data []*User `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this user response +func (m *UserResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UserResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UserResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this user response based on the context it is used +func (m *UserResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UserResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UserResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UserResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UserResponse) UnmarshalBinary(b []byte) error { + var res UserResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/devops/devops_models/user_role.go b/api/devops/devops_models/user_role.go new file mode 100644 index 0000000..eea9e81 --- /dev/null +++ b/api/devops/devops_models/user_role.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package devops_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" +) + +// UserRole Relationship object that connects user to a role +// +// swagger:model UserRole +type UserRole struct { + + // Account Id + AccountID string `json:"AccountID,omitempty"` + + // Linked role ID + Auth0RoleID string `json:"Auth0RoleID,omitempty"` + + // Auth0 User ID + Auth0UserID string `json:"Auth0UserID,omitempty"` + + // Company Name + CompanyName string `json:"CompanyName,omitempty"` + + // Contact ID + ContactID string `json:"ContactID,omitempty"` + + // Role description + RoleDescription string `json:"RoleDescription,omitempty"` + + // The Role ID + RoleID string `json:"RoleID,omitempty"` + + // Role Name + RoleName string `json:"RoleName,omitempty"` + + // Telnexus Account Number + TelnexusAccount string `json:"TelnexusAccount,omitempty"` + + // User Email Address + UserEmail string `json:"UserEmail,omitempty"` + + // User Full Name + UserFullName string `json:"UserFullName,omitempty"` + + // The User ID + UserID string `json:"UserID,omitempty"` + + // Username + Username string `json:"Username,omitempty"` +} + +// Validate validates this user role +func (m *UserRole) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this user role based on context it is used +func (m *UserRole) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UserRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UserRole) UnmarshalBinary(b []byte) error { + var res UserRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/isp/isp_client/isp_client.go b/api/isp/isp_client/isp_client.go new file mode 100644 index 0000000..2f31526 --- /dev/null +++ b/api/isp/isp_client/isp_client.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package isp_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" + + "code.tnxs.net/telnexus/lib/api/isp/isp_client/zone" +) + +// Default isp HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "isp.infra.tnxs.net:8080" + // 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 +var DefaultSchemes = []string{"http"} + +// NewHTTPClient creates a new isp HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Isp { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new isp HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Isp { + // ensure nullable parameters have default + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new isp client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Isp { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Isp) + cli.Transport = transport + cli.Zone = zone.New(transport, formats) + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// Isp is a client for isp +type Isp struct { + Zone zone.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Isp) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.Zone.SetTransport(transport) +} diff --git a/api/isp/isp_client/zone/get_zones_parameters.go b/api/isp/isp_client/zone/get_zones_parameters.go new file mode 100644 index 0000000..ac0eba7 --- /dev/null +++ b/api/isp/isp_client/zone/get_zones_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package zone + +// 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" +) + +// NewGetZonesParams creates a new GetZonesParams 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 NewGetZonesParams() *GetZonesParams { + return &GetZonesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetZonesParamsWithTimeout creates a new GetZonesParams object +// with the ability to set a timeout on a request. +func NewGetZonesParamsWithTimeout(timeout time.Duration) *GetZonesParams { + return &GetZonesParams{ + timeout: timeout, + } +} + +// NewGetZonesParamsWithContext creates a new GetZonesParams object +// with the ability to set a context for a request. +func NewGetZonesParamsWithContext(ctx context.Context) *GetZonesParams { + return &GetZonesParams{ + Context: ctx, + } +} + +// NewGetZonesParamsWithHTTPClient creates a new GetZonesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetZonesParamsWithHTTPClient(client *http.Client) *GetZonesParams { + return &GetZonesParams{ + HTTPClient: client, + } +} + +/* GetZonesParams contains all the parameters to send to the API endpoint + for the get zones operation. + + Typically these are written to a http.Request. +*/ +type GetZonesParams struct { + + /* Limit. + + How many objects to return at one time (max 300, default 100) + + Format: int64 + Default: 100 + */ + Limit *int64 + + /* Offset. + + How many objects to skip? (default 0) + + Format: int64 + */ + Offset *int64 + + /* ZoneID. + + Telnexus Record Id of a Zone + */ + ZoneID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get zones params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetZonesParams) WithDefaults() *GetZonesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get zones params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetZonesParams) SetDefaults() { + var ( + limitDefault = int64(100) + + offsetDefault = int64(0) + ) + + val := GetZonesParams{ + Limit: &limitDefault, + Offset: &offsetDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the get zones params +func (o *GetZonesParams) WithTimeout(timeout time.Duration) *GetZonesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get zones params +func (o *GetZonesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get zones params +func (o *GetZonesParams) WithContext(ctx context.Context) *GetZonesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get zones params +func (o *GetZonesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get zones params +func (o *GetZonesParams) WithHTTPClient(client *http.Client) *GetZonesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get zones params +func (o *GetZonesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the get zones params +func (o *GetZonesParams) WithLimit(limit *int64) *GetZonesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get zones params +func (o *GetZonesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get zones params +func (o *GetZonesParams) WithOffset(offset *int64) *GetZonesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get zones params +func (o *GetZonesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithZoneID adds the zoneID to the get zones params +func (o *GetZonesParams) WithZoneID(zoneID *string) *GetZonesParams { + o.SetZoneID(zoneID) + return o +} + +// SetZoneID adds the zoneId to the get zones params +func (o *GetZonesParams) SetZoneID(zoneID *string) { + o.ZoneID = zoneID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetZonesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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 o.ZoneID != nil { + + // query param zoneId + var qrZoneID string + + if o.ZoneID != nil { + qrZoneID = *o.ZoneID + } + qZoneID := qrZoneID + if qZoneID != "" { + + if err := r.SetQueryParam("zoneId", qZoneID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/isp/isp_client/zone/get_zones_responses.go b/api/isp/isp_client/zone/get_zones_responses.go new file mode 100644 index 0000000..4907604 --- /dev/null +++ b/api/isp/isp_client/zone/get_zones_responses.go @@ -0,0 +1,363 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package zone + +// 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/telnexus/lib/api/isp/isp_models" +) + +// GetZonesReader is a Reader for the GetZones structure. +type GetZonesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetZonesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetZonesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetZonesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetZonesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetZonesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetZonesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetZonesInternalServerError() + 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()) + } +} + +// NewGetZonesOK creates a GetZonesOK with default headers values +func NewGetZonesOK() *GetZonesOK { + return &GetZonesOK{} +} + +/* GetZonesOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of Zone objects +*/ +type GetZonesOK struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *isp_models.ZoneResponse +} + +func (o *GetZonesOK) Error() string { + return fmt.Sprintf("[GET /zone][%d] getZonesOK %+v", 200, o.Payload) +} +func (o *GetZonesOK) GetPayload() *isp_models.ZoneResponse { + return o.Payload +} + +func (o *GetZonesOK) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(isp_models.ZoneResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetZonesUnauthorized creates a GetZonesUnauthorized with default headers values +func NewGetZonesUnauthorized() *GetZonesUnauthorized { + return &GetZonesUnauthorized{} +} + +/* GetZonesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetZonesUnauthorized struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *isp_models.Error +} + +func (o *GetZonesUnauthorized) Error() string { + return fmt.Sprintf("[GET /zone][%d] getZonesUnauthorized %+v", 401, o.Payload) +} +func (o *GetZonesUnauthorized) GetPayload() *isp_models.Error { + return o.Payload +} + +func (o *GetZonesUnauthorized) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(isp_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetZonesForbidden creates a GetZonesForbidden with default headers values +func NewGetZonesForbidden() *GetZonesForbidden { + return &GetZonesForbidden{} +} + +/* GetZonesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetZonesForbidden struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *isp_models.Error +} + +func (o *GetZonesForbidden) Error() string { + return fmt.Sprintf("[GET /zone][%d] getZonesForbidden %+v", 403, o.Payload) +} +func (o *GetZonesForbidden) GetPayload() *isp_models.Error { + return o.Payload +} + +func (o *GetZonesForbidden) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(isp_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetZonesNotFound creates a GetZonesNotFound with default headers values +func NewGetZonesNotFound() *GetZonesNotFound { + return &GetZonesNotFound{} +} + +/* GetZonesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetZonesNotFound struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *isp_models.Error +} + +func (o *GetZonesNotFound) Error() string { + return fmt.Sprintf("[GET /zone][%d] getZonesNotFound %+v", 404, o.Payload) +} +func (o *GetZonesNotFound) GetPayload() *isp_models.Error { + return o.Payload +} + +func (o *GetZonesNotFound) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(isp_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetZonesUnprocessableEntity creates a GetZonesUnprocessableEntity with default headers values +func NewGetZonesUnprocessableEntity() *GetZonesUnprocessableEntity { + return &GetZonesUnprocessableEntity{} +} + +/* GetZonesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetZonesUnprocessableEntity struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *isp_models.Error +} + +func (o *GetZonesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /zone][%d] getZonesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetZonesUnprocessableEntity) GetPayload() *isp_models.Error { + return o.Payload +} + +func (o *GetZonesUnprocessableEntity) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(isp_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetZonesInternalServerError creates a GetZonesInternalServerError with default headers values +func NewGetZonesInternalServerError() *GetZonesInternalServerError { + return &GetZonesInternalServerError{} +} + +/* GetZonesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetZonesInternalServerError struct { + AccessControlAllowOrigin string + CacheControl string + + Payload *isp_models.Error +} + +func (o *GetZonesInternalServerError) Error() string { + return fmt.Sprintf("[GET /zone][%d] getZonesInternalServerError %+v", 500, o.Payload) +} +func (o *GetZonesInternalServerError) GetPayload() *isp_models.Error { + return o.Payload +} + +func (o *GetZonesInternalServerError) 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 + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + o.Payload = new(isp_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/isp/isp_client/zone/zone_client.go b/api/isp/isp_client/zone/zone_client.go new file mode 100644 index 0000000..0da6283 --- /dev/null +++ b/api/isp/isp_client/zone/zone_client.go @@ -0,0 +1,86 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package zone + +// 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 zone API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for zone 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 { + GetZones(params *GetZonesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetZonesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetZones gets DNS zones + + Get DNS Zones +*/ +func (a *Client) GetZones(params *GetZonesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetZonesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetZonesParams() + } + op := &runtime.ClientOperation{ + ID: "getZones", + Method: "GET", + PathPattern: "/zone", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetZonesReader{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.(*GetZonesOK) + 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 getZones: 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 +} diff --git a/api/isp/isp_models/error.go b/api/isp/isp_models/error.go new file mode 100644 index 0000000..3e79517 --- /dev/null +++ b/api/isp/isp_models/error.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package isp_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" +) + +// Error error +// +// swagger:model Error +type Error struct { + + // code + Code int64 `json:"code,omitempty"` + + // fields + Fields string `json:"fields,omitempty"` + + // message + Message string `json:"message,omitempty"` +} + +// Validate validates this error +func (m *Error) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this error based on context it is used +func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Error) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Error) UnmarshalBinary(b []byte) error { + var res Error + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/isp/isp_models/registrar.go b/api/isp/isp_models/registrar.go new file mode 100644 index 0000000..5df0526 --- /dev/null +++ b/api/isp/isp_models/registrar.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package isp_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" +) + +// Registrar registrar +// +// swagger:model Registrar +type Registrar struct { + + // Account + AccountID string `json:"AccountID,omitempty"` + + // Contact + ContactID string `json:"ContactID,omitempty"` + + // Created By + CreatedByID string `json:"CreatedById,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // End Date + DateEnd string `json:"DateEnd,omitempty"` + + // Start Date + DateStart string `json:"DateStart,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // Record Id + ID string `json:"ID,omitempty"` + + // Last Modified By + LastModifiedByID string `json:"LastModifiedById,omitempty"` + + // Last Modifed Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Registrar Name + RegistrarName string `json:"RegistrarName,omitempty"` + + // Registrar URL + URL string `json:"URL,omitempty"` +} + +// Validate validates this registrar +func (m *Registrar) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this registrar based on context it is used +func (m *Registrar) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Registrar) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Registrar) UnmarshalBinary(b []byte) error { + var res Registrar + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/isp/isp_models/response_meta.go b/api/isp/isp_models/response_meta.go new file mode 100644 index 0000000..d6909a7 --- /dev/null +++ b/api/isp/isp_models/response_meta.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package isp_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" +) + +// ResponseMeta response meta +// +// swagger:model ResponseMeta +type ResponseMeta struct { + + // Microservice Contact Info + Contact string `json:"Contact,omitempty"` + + // Copyright Info + Copyright string `json:"Copyright,omitempty"` + + // License Information and Restrictions + License string `json:"License,omitempty"` + + // Operation ID + OperationID string `json:"OperationID,omitempty"` + + // Request IP Address + RequestIP string `json:"RequestIP,omitempty"` + + // Request Type + RequestType string `json:"RequestType,omitempty"` + + // Request URL + RequestURL string `json:"RequestURL,omitempty"` + + // Data Server Info + ServerInfo string `json:"ServerInfo,omitempty"` + + // Data Server Response Time (ms) + ServerResponseTime string `json:"ServerResponseTime,omitempty"` + + // Backend Server Timestamp + ServerTimestamp string `json:"ServerTimestamp,omitempty"` + + // Telnexus Account Number used for recording transactions + TelnexusAccount string `json:"TelnexusAccount,omitempty"` +} + +// Validate validates this response meta +func (m *ResponseMeta) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this response meta based on context it is used +func (m *ResponseMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ResponseMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ResponseMeta) UnmarshalBinary(b []byte) error { + var res ResponseMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/isp/isp_models/zone.go b/api/isp/isp_models/zone.go new file mode 100644 index 0000000..14050b3 --- /dev/null +++ b/api/isp/isp_models/zone.go @@ -0,0 +1,102 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package isp_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" +) + +// Zone zone +// +// swagger:model Zone +type Zone struct { + + // Account + AccountID string `json:"AccountID,omitempty"` + + // Contact + ContactID string `json:"ContactID,omitempty"` + + // Created By + CreatedByID string `json:"CreatedById,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // End Date + DateEnd string `json:"DateEnd,omitempty"` + + // Start Date + DateStart string `json:"DateStart,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // Expiration Date + ExpirationDate string `json:"ExpirationDate,omitempty"` + + // The ID of the Host upon which this Zone is hosted + HostID string `json:"HostID,omitempty"` + + // Record Id + ID string `json:"ID,omitempty"` + + // ID Protect? + IDProtect bool `json:"IDProtect,omitempty"` + + // Last Modified By + LastModifiedByID string `json:"LastModifiedById,omitempty"` + + // Last Modifed Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Auto Renew? + PeriodStartID bool `json:"PeriodStartID,omitempty"` + + // ID of the Registar that owns this zone instance + RegistrarID string `json:"RegistrarID,omitempty"` + + // Term + Term string `json:"Term,omitempty"` + + // Zone Name + ZoneName string `json:"ZoneName,omitempty"` +} + +// Validate validates this zone +func (m *Zone) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this zone based on context it is used +func (m *Zone) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Zone) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Zone) UnmarshalBinary(b []byte) error { + var res Zone + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/isp/isp_models/zone_response.go b/api/isp/isp_models/zone_response.go new file mode 100644 index 0000000..59fee6e --- /dev/null +++ b/api/isp/isp_models/zone_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package isp_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ZoneResponse An array of Zone objects +// +// swagger:model ZoneResponse +type ZoneResponse struct { + + // data + Data []*Zone `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this zone response +func (m *ZoneResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ZoneResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ZoneResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this zone response based on the context it is used +func (m *ZoneResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ZoneResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ZoneResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ZoneResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ZoneResponse) UnmarshalBinary(b []byte) error { + var res ZoneResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/kazoo/kazoo_client/account/account_client.go b/api/kazoo/kazoo_client/account/account_client.go new file mode 100644 index 0000000..cf10b1c --- /dev/null +++ b/api/kazoo/kazoo_client/account/account_client.go @@ -0,0 +1,125 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package account + +// 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 account API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for account 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 { + GetAccountDescendents(params *GetAccountDescendentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountDescendentsOK, error) + + GetAccounts(params *GetAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetAccountDescendents get account descendents API +*/ +func (a *Client) GetAccountDescendents(params *GetAccountDescendentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountDescendentsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAccountDescendentsParams() + } + op := &runtime.ClientOperation{ + ID: "getAccountDescendents", + Method: "GET", + PathPattern: "/accounts/{accountId}/descendents", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetAccountDescendentsReader{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.(*GetAccountDescendentsOK) + 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 getAccountDescendents: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetAccounts get accounts API +*/ +func (a *Client) GetAccounts(params *GetAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAccountsParams() + } + op := &runtime.ClientOperation{ + ID: "getAccounts", + Method: "GET", + PathPattern: "/accounts/{accountId}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + 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) + if err != nil { + return nil, err + } + 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 + 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) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/api/kazoo/kazoo_client/account/get_account_descendents_parameters.go b/api/kazoo/kazoo_client/account/get_account_descendents_parameters.go new file mode 100644 index 0000000..18845e9 --- /dev/null +++ b/api/kazoo/kazoo_client/account/get_account_descendents_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package account + +// 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" +) + +// NewGetAccountDescendentsParams creates a new GetAccountDescendentsParams 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 NewGetAccountDescendentsParams() *GetAccountDescendentsParams { + return &GetAccountDescendentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAccountDescendentsParamsWithTimeout creates a new GetAccountDescendentsParams object +// with the ability to set a timeout on a request. +func NewGetAccountDescendentsParamsWithTimeout(timeout time.Duration) *GetAccountDescendentsParams { + return &GetAccountDescendentsParams{ + timeout: timeout, + } +} + +// NewGetAccountDescendentsParamsWithContext creates a new GetAccountDescendentsParams object +// with the ability to set a context for a request. +func NewGetAccountDescendentsParamsWithContext(ctx context.Context) *GetAccountDescendentsParams { + return &GetAccountDescendentsParams{ + Context: ctx, + } +} + +// NewGetAccountDescendentsParamsWithHTTPClient creates a new GetAccountDescendentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAccountDescendentsParamsWithHTTPClient(client *http.Client) *GetAccountDescendentsParams { + return &GetAccountDescendentsParams{ + HTTPClient: client, + } +} + +/* GetAccountDescendentsParams contains all the parameters to send to the API endpoint + for the get account descendents operation. + + Typically these are written to a http.Request. +*/ +type GetAccountDescendentsParams struct { + + // AccountID. + AccountID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get account descendents params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountDescendentsParams) WithDefaults() *GetAccountDescendentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get account descendents params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountDescendentsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get account descendents params +func (o *GetAccountDescendentsParams) WithTimeout(timeout time.Duration) *GetAccountDescendentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get account descendents params +func (o *GetAccountDescendentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get account descendents params +func (o *GetAccountDescendentsParams) WithContext(ctx context.Context) *GetAccountDescendentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get account descendents params +func (o *GetAccountDescendentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get account descendents params +func (o *GetAccountDescendentsParams) WithHTTPClient(client *http.Client) *GetAccountDescendentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get account descendents params +func (o *GetAccountDescendentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get account descendents params +func (o *GetAccountDescendentsParams) WithAccountID(accountID string) *GetAccountDescendentsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get account descendents params +func (o *GetAccountDescendentsParams) SetAccountID(accountID string) { + o.AccountID = accountID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAccountDescendentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param accountId + if err := r.SetPathParam("accountId", o.AccountID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/kazoo/kazoo_client/account/get_account_descendents_responses.go b/api/kazoo/kazoo_client/account/get_account_descendents_responses.go new file mode 100644 index 0000000..ebb52af --- /dev/null +++ b/api/kazoo/kazoo_client/account/get_account_descendents_responses.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package account + +// 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/telnexus/lib/api/kazoo/kazoo_models" +) + +// GetAccountDescendentsReader is a Reader for the GetAccountDescendents structure. +type GetAccountDescendentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAccountDescendentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAccountDescendentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetAccountDescendentsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetAccountDescendentsNotFound() + 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()) + } +} + +// NewGetAccountDescendentsOK creates a GetAccountDescendentsOK with default headers values +func NewGetAccountDescendentsOK() *GetAccountDescendentsOK { + return &GetAccountDescendentsOK{} +} + +/* GetAccountDescendentsOK describes a response with status code 200, with default header values. + +Kazoo response +*/ +type GetAccountDescendentsOK struct { + Payload *kazoo_models.GetAccountDescendentResponse +} + +func (o *GetAccountDescendentsOK) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/descendents][%d] getAccountDescendentsOK %+v", 200, o.Payload) +} +func (o *GetAccountDescendentsOK) GetPayload() *kazoo_models.GetAccountDescendentResponse { + return o.Payload +} + +func (o *GetAccountDescendentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.GetAccountDescendentResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountDescendentsUnauthorized creates a GetAccountDescendentsUnauthorized with default headers values +func NewGetAccountDescendentsUnauthorized() *GetAccountDescendentsUnauthorized { + return &GetAccountDescendentsUnauthorized{} +} + +/* GetAccountDescendentsUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetAccountDescendentsUnauthorized struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountDescendentsUnauthorized) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/descendents][%d] getAccountDescendentsUnauthorized %+v", 401, o.Payload) +} +func (o *GetAccountDescendentsUnauthorized) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountDescendentsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountDescendentsNotFound creates a GetAccountDescendentsNotFound with default headers values +func NewGetAccountDescendentsNotFound() *GetAccountDescendentsNotFound { + return &GetAccountDescendentsNotFound{} +} + +/* GetAccountDescendentsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetAccountDescendentsNotFound struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountDescendentsNotFound) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/descendents][%d] getAccountDescendentsNotFound %+v", 404, o.Payload) +} +func (o *GetAccountDescendentsNotFound) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountDescendentsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/kazoo/kazoo_client/account/get_accounts_parameters.go b/api/kazoo/kazoo_client/account/get_accounts_parameters.go new file mode 100644 index 0000000..b351a0b --- /dev/null +++ b/api/kazoo/kazoo_client/account/get_accounts_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package account + +// 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" +) + +// NewGetAccountsParams creates a new GetAccountsParams 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 NewGetAccountsParams() *GetAccountsParams { + return &GetAccountsParams{ + timeout: 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, + } +} + +// NewGetAccountsParamsWithContext creates a new GetAccountsParams object +// with the ability to set a context for a request. +func NewGetAccountsParamsWithContext(ctx context.Context) *GetAccountsParams { + return &GetAccountsParams{ + Context: ctx, + } +} + +// NewGetAccountsParamsWithHTTPClient creates a new GetAccountsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAccountsParamsWithHTTPClient(client *http.Client) *GetAccountsParams { + return &GetAccountsParams{ + HTTPClient: client, + } +} + +/* GetAccountsParams contains all the parameters to send to the API endpoint + for the get accounts operation. + + Typically these are written to a http.Request. +*/ +type GetAccountsParams struct { + + // AccountID. + AccountID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountsParams) WithDefaults() *GetAccountsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get accounts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountsParams) SetDefaults() { + // no default values defined for this parameter +} + +// 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 +func (o *GetAccountsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get accounts params +func (o *GetAccountsParams) WithContext(ctx context.Context) *GetAccountsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get accounts params +func (o *GetAccountsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// 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 +func (o *GetAccountsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// 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 +func (o *GetAccountsParams) SetAccountID(accountID string) { + o.AccountID = accountID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param accountId + if err := r.SetPathParam("accountId", o.AccountID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/kazoo/kazoo_client/account/get_accounts_responses.go b/api/kazoo/kazoo_client/account/get_accounts_responses.go new file mode 100644 index 0000000..0eaea00 --- /dev/null +++ b/api/kazoo/kazoo_client/account/get_accounts_responses.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package account + +// 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/telnexus/lib/api/kazoo/kazoo_models" +) + +// GetAccountsReader is a Reader for the GetAccounts structure. +type GetAccountsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAccountsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetAccountsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetAccountsNotFound() + 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()) + } +} + +// NewGetAccountsOK creates a GetAccountsOK with default headers values +func NewGetAccountsOK() *GetAccountsOK { + return &GetAccountsOK{} +} + +/* GetAccountsOK describes a response with status code 200, with default header values. + +Kazoo response +*/ +type GetAccountsOK struct { + Payload *kazoo_models.GetAccountResponse +} + +func (o *GetAccountsOK) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}][%d] getAccountsOK %+v", 200, o.Payload) +} +func (o *GetAccountsOK) GetPayload() *kazoo_models.GetAccountResponse { + return o.Payload +} + +func (o *GetAccountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.GetAccountResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountsUnauthorized creates a GetAccountsUnauthorized with default headers values +func NewGetAccountsUnauthorized() *GetAccountsUnauthorized { + return &GetAccountsUnauthorized{} +} + +/* GetAccountsUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetAccountsUnauthorized struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountsUnauthorized) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}][%d] getAccountsUnauthorized %+v", 401, o.Payload) +} +func (o *GetAccountsUnauthorized) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountsNotFound creates a GetAccountsNotFound with default headers values +func NewGetAccountsNotFound() *GetAccountsNotFound { + return &GetAccountsNotFound{} +} + +/* GetAccountsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetAccountsNotFound struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountsNotFound) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}][%d] getAccountsNotFound %+v", 404, o.Payload) +} +func (o *GetAccountsNotFound) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/kazoo/kazoo_client/call_flow/call_flow_client.go b/api/kazoo/kazoo_client/call_flow/call_flow_client.go new file mode 100644 index 0000000..9562915 --- /dev/null +++ b/api/kazoo/kazoo_client/call_flow/call_flow_client.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package call_flow + +// 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 call flow API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for call flow 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 { + GetAccountCallflows(params *GetAccountCallflowsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountCallflowsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetAccountCallflows get account callflows API +*/ +func (a *Client) GetAccountCallflows(params *GetAccountCallflowsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountCallflowsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAccountCallflowsParams() + } + op := &runtime.ClientOperation{ + ID: "getAccountCallflows", + Method: "GET", + PathPattern: "/accounts/{accountId}/callflows", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetAccountCallflowsReader{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.(*GetAccountCallflowsOK) + 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 getAccountCallflows: 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 +} diff --git a/api/kazoo/kazoo_client/call_flow/get_account_callflows_parameters.go b/api/kazoo/kazoo_client/call_flow/get_account_callflows_parameters.go new file mode 100644 index 0000000..6397d6e --- /dev/null +++ b/api/kazoo/kazoo_client/call_flow/get_account_callflows_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package call_flow + +// 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" +) + +// NewGetAccountCallflowsParams creates a new GetAccountCallflowsParams 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 NewGetAccountCallflowsParams() *GetAccountCallflowsParams { + return &GetAccountCallflowsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAccountCallflowsParamsWithTimeout creates a new GetAccountCallflowsParams object +// with the ability to set a timeout on a request. +func NewGetAccountCallflowsParamsWithTimeout(timeout time.Duration) *GetAccountCallflowsParams { + return &GetAccountCallflowsParams{ + timeout: timeout, + } +} + +// NewGetAccountCallflowsParamsWithContext creates a new GetAccountCallflowsParams object +// with the ability to set a context for a request. +func NewGetAccountCallflowsParamsWithContext(ctx context.Context) *GetAccountCallflowsParams { + return &GetAccountCallflowsParams{ + Context: ctx, + } +} + +// NewGetAccountCallflowsParamsWithHTTPClient creates a new GetAccountCallflowsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAccountCallflowsParamsWithHTTPClient(client *http.Client) *GetAccountCallflowsParams { + return &GetAccountCallflowsParams{ + HTTPClient: client, + } +} + +/* GetAccountCallflowsParams contains all the parameters to send to the API endpoint + for the get account callflows operation. + + Typically these are written to a http.Request. +*/ +type GetAccountCallflowsParams struct { + + // AccountID. + AccountID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get account callflows params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountCallflowsParams) WithDefaults() *GetAccountCallflowsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get account callflows params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountCallflowsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get account callflows params +func (o *GetAccountCallflowsParams) WithTimeout(timeout time.Duration) *GetAccountCallflowsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get account callflows params +func (o *GetAccountCallflowsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get account callflows params +func (o *GetAccountCallflowsParams) WithContext(ctx context.Context) *GetAccountCallflowsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get account callflows params +func (o *GetAccountCallflowsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get account callflows params +func (o *GetAccountCallflowsParams) WithHTTPClient(client *http.Client) *GetAccountCallflowsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get account callflows params +func (o *GetAccountCallflowsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get account callflows params +func (o *GetAccountCallflowsParams) WithAccountID(accountID string) *GetAccountCallflowsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get account callflows params +func (o *GetAccountCallflowsParams) SetAccountID(accountID string) { + o.AccountID = accountID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAccountCallflowsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param accountId + if err := r.SetPathParam("accountId", o.AccountID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/kazoo/kazoo_client/call_flow/get_account_callflows_responses.go b/api/kazoo/kazoo_client/call_flow/get_account_callflows_responses.go new file mode 100644 index 0000000..9bc43e1 --- /dev/null +++ b/api/kazoo/kazoo_client/call_flow/get_account_callflows_responses.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package call_flow + +// 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/telnexus/lib/api/kazoo/kazoo_models" +) + +// GetAccountCallflowsReader is a Reader for the GetAccountCallflows structure. +type GetAccountCallflowsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAccountCallflowsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAccountCallflowsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetAccountCallflowsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetAccountCallflowsNotFound() + 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()) + } +} + +// NewGetAccountCallflowsOK creates a GetAccountCallflowsOK with default headers values +func NewGetAccountCallflowsOK() *GetAccountCallflowsOK { + return &GetAccountCallflowsOK{} +} + +/* GetAccountCallflowsOK describes a response with status code 200, with default header values. + +Kazoo response +*/ +type GetAccountCallflowsOK struct { + Payload *kazoo_models.GetAccountCallflowResponse +} + +func (o *GetAccountCallflowsOK) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/callflows][%d] getAccountCallflowsOK %+v", 200, o.Payload) +} +func (o *GetAccountCallflowsOK) GetPayload() *kazoo_models.GetAccountCallflowResponse { + return o.Payload +} + +func (o *GetAccountCallflowsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.GetAccountCallflowResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountCallflowsUnauthorized creates a GetAccountCallflowsUnauthorized with default headers values +func NewGetAccountCallflowsUnauthorized() *GetAccountCallflowsUnauthorized { + return &GetAccountCallflowsUnauthorized{} +} + +/* GetAccountCallflowsUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetAccountCallflowsUnauthorized struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountCallflowsUnauthorized) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/callflows][%d] getAccountCallflowsUnauthorized %+v", 401, o.Payload) +} +func (o *GetAccountCallflowsUnauthorized) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountCallflowsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountCallflowsNotFound creates a GetAccountCallflowsNotFound with default headers values +func NewGetAccountCallflowsNotFound() *GetAccountCallflowsNotFound { + return &GetAccountCallflowsNotFound{} +} + +/* GetAccountCallflowsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetAccountCallflowsNotFound struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountCallflowsNotFound) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/callflows][%d] getAccountCallflowsNotFound %+v", 404, o.Payload) +} +func (o *GetAccountCallflowsNotFound) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountCallflowsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/kazoo/kazoo_client/cdr/cdr_client.go b/api/kazoo/kazoo_client/cdr/cdr_client.go new file mode 100644 index 0000000..8bfea6d --- /dev/null +++ b/api/kazoo/kazoo_client/cdr/cdr_client.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cdr + +// 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 cdr API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for cdr 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 { + GetAccountCDRs(params *GetAccountCDRsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountCDRsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetAccountCDRs get account c d rs API +*/ +func (a *Client) GetAccountCDRs(params *GetAccountCDRsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountCDRsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAccountCDRsParams() + } + op := &runtime.ClientOperation{ + ID: "getAccountCDRs", + Method: "GET", + PathPattern: "/accounts/{accountId}/cdrs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetAccountCDRsReader{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.(*GetAccountCDRsOK) + 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 getAccountCDRs: 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 +} diff --git a/api/kazoo/kazoo_client/cdr/get_account_c_d_rs_parameters.go b/api/kazoo/kazoo_client/cdr/get_account_c_d_rs_parameters.go new file mode 100644 index 0000000..892aefc --- /dev/null +++ b/api/kazoo/kazoo_client/cdr/get_account_c_d_rs_parameters.go @@ -0,0 +1,203 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cdr + +// 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" +) + +// NewGetAccountCDRsParams creates a new GetAccountCDRsParams 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 NewGetAccountCDRsParams() *GetAccountCDRsParams { + return &GetAccountCDRsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAccountCDRsParamsWithTimeout creates a new GetAccountCDRsParams object +// with the ability to set a timeout on a request. +func NewGetAccountCDRsParamsWithTimeout(timeout time.Duration) *GetAccountCDRsParams { + return &GetAccountCDRsParams{ + timeout: timeout, + } +} + +// NewGetAccountCDRsParamsWithContext creates a new GetAccountCDRsParams object +// with the ability to set a context for a request. +func NewGetAccountCDRsParamsWithContext(ctx context.Context) *GetAccountCDRsParams { + return &GetAccountCDRsParams{ + Context: ctx, + } +} + +// NewGetAccountCDRsParamsWithHTTPClient creates a new GetAccountCDRsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAccountCDRsParamsWithHTTPClient(client *http.Client) *GetAccountCDRsParams { + return &GetAccountCDRsParams{ + HTTPClient: client, + } +} + +/* GetAccountCDRsParams contains all the parameters to send to the API endpoint + for the get account c d rs operation. + + Typically these are written to a http.Request. +*/ +type GetAccountCDRsParams struct { + + // AccountID. + AccountID string + + // CreatedFrom. + // + // Format: int64 + CreatedFrom int64 + + // CreatedTo. + // + // Format: int64 + CreatedTo int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get account c d rs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountCDRsParams) WithDefaults() *GetAccountCDRsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get account c d rs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountCDRsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get account c d rs params +func (o *GetAccountCDRsParams) WithTimeout(timeout time.Duration) *GetAccountCDRsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get account c d rs params +func (o *GetAccountCDRsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get account c d rs params +func (o *GetAccountCDRsParams) WithContext(ctx context.Context) *GetAccountCDRsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get account c d rs params +func (o *GetAccountCDRsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get account c d rs params +func (o *GetAccountCDRsParams) WithHTTPClient(client *http.Client) *GetAccountCDRsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get account c d rs params +func (o *GetAccountCDRsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get account c d rs params +func (o *GetAccountCDRsParams) WithAccountID(accountID string) *GetAccountCDRsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get account c d rs params +func (o *GetAccountCDRsParams) SetAccountID(accountID string) { + o.AccountID = accountID +} + +// WithCreatedFrom adds the createdFrom to the get account c d rs params +func (o *GetAccountCDRsParams) WithCreatedFrom(createdFrom int64) *GetAccountCDRsParams { + o.SetCreatedFrom(createdFrom) + return o +} + +// SetCreatedFrom adds the createdFrom to the get account c d rs params +func (o *GetAccountCDRsParams) SetCreatedFrom(createdFrom int64) { + o.CreatedFrom = createdFrom +} + +// WithCreatedTo adds the createdTo to the get account c d rs params +func (o *GetAccountCDRsParams) WithCreatedTo(createdTo int64) *GetAccountCDRsParams { + o.SetCreatedTo(createdTo) + return o +} + +// SetCreatedTo adds the createdTo to the get account c d rs params +func (o *GetAccountCDRsParams) SetCreatedTo(createdTo int64) { + o.CreatedTo = createdTo +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAccountCDRsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param accountId + if err := r.SetPathParam("accountId", o.AccountID); err != nil { + return err + } + + // query param created_from + qrCreatedFrom := o.CreatedFrom + qCreatedFrom := swag.FormatInt64(qrCreatedFrom) + if qCreatedFrom != "" { + + if err := r.SetQueryParam("created_from", qCreatedFrom); err != nil { + return err + } + } + + // query param created_to + qrCreatedTo := o.CreatedTo + qCreatedTo := swag.FormatInt64(qrCreatedTo) + if qCreatedTo != "" { + + if err := r.SetQueryParam("created_to", qCreatedTo); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/kazoo/kazoo_client/cdr/get_account_c_d_rs_responses.go b/api/kazoo/kazoo_client/cdr/get_account_c_d_rs_responses.go new file mode 100644 index 0000000..010958b --- /dev/null +++ b/api/kazoo/kazoo_client/cdr/get_account_c_d_rs_responses.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cdr + +// 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/telnexus/lib/api/kazoo/kazoo_models" +) + +// GetAccountCDRsReader is a Reader for the GetAccountCDRs structure. +type GetAccountCDRsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAccountCDRsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAccountCDRsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetAccountCDRsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetAccountCDRsNotFound() + 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()) + } +} + +// NewGetAccountCDRsOK creates a GetAccountCDRsOK with default headers values +func NewGetAccountCDRsOK() *GetAccountCDRsOK { + return &GetAccountCDRsOK{} +} + +/* GetAccountCDRsOK describes a response with status code 200, with default header values. + +Kazoo response +*/ +type GetAccountCDRsOK struct { + Payload *kazoo_models.GetAccountCdrResponse +} + +func (o *GetAccountCDRsOK) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/cdrs][%d] getAccountCDRsOK %+v", 200, o.Payload) +} +func (o *GetAccountCDRsOK) GetPayload() *kazoo_models.GetAccountCdrResponse { + return o.Payload +} + +func (o *GetAccountCDRsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.GetAccountCdrResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountCDRsUnauthorized creates a GetAccountCDRsUnauthorized with default headers values +func NewGetAccountCDRsUnauthorized() *GetAccountCDRsUnauthorized { + return &GetAccountCDRsUnauthorized{} +} + +/* GetAccountCDRsUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetAccountCDRsUnauthorized struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountCDRsUnauthorized) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/cdrs][%d] getAccountCDRsUnauthorized %+v", 401, o.Payload) +} +func (o *GetAccountCDRsUnauthorized) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountCDRsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountCDRsNotFound creates a GetAccountCDRsNotFound with default headers values +func NewGetAccountCDRsNotFound() *GetAccountCDRsNotFound { + return &GetAccountCDRsNotFound{} +} + +/* GetAccountCDRsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetAccountCDRsNotFound struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountCDRsNotFound) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/cdrs][%d] getAccountCDRsNotFound %+v", 404, o.Payload) +} +func (o *GetAccountCDRsNotFound) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountCDRsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/kazoo/kazoo_client/device/device_client.go b/api/kazoo/kazoo_client/device/device_client.go new file mode 100644 index 0000000..57c64f3 --- /dev/null +++ b/api/kazoo/kazoo_client/device/device_client.go @@ -0,0 +1,125 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package device + +// 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 device API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for device 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 { + GetAccountDevices(params *GetAccountDevicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountDevicesOK, error) + + GetUserDevices(params *GetUserDevicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUserDevicesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetAccountDevices get account devices API +*/ +func (a *Client) GetAccountDevices(params *GetAccountDevicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountDevicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAccountDevicesParams() + } + op := &runtime.ClientOperation{ + ID: "getAccountDevices", + Method: "GET", + PathPattern: "/accounts/{accountId}/devices", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetAccountDevicesReader{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.(*GetAccountDevicesOK) + 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 getAccountDevices: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetUserDevices get user devices API +*/ +func (a *Client) GetUserDevices(params *GetUserDevicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUserDevicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetUserDevicesParams() + } + op := &runtime.ClientOperation{ + ID: "getUserDevices", + Method: "GET", + PathPattern: "/accounts/{accountId}/users/{userId}/devices", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetUserDevicesReader{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.(*GetUserDevicesOK) + 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 getUserDevices: 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 +} diff --git a/api/kazoo/kazoo_client/device/get_account_devices_parameters.go b/api/kazoo/kazoo_client/device/get_account_devices_parameters.go new file mode 100644 index 0000000..bc48f53 --- /dev/null +++ b/api/kazoo/kazoo_client/device/get_account_devices_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package device + +// 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" +) + +// NewGetAccountDevicesParams creates a new GetAccountDevicesParams 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 NewGetAccountDevicesParams() *GetAccountDevicesParams { + return &GetAccountDevicesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAccountDevicesParamsWithTimeout creates a new GetAccountDevicesParams object +// with the ability to set a timeout on a request. +func NewGetAccountDevicesParamsWithTimeout(timeout time.Duration) *GetAccountDevicesParams { + return &GetAccountDevicesParams{ + timeout: timeout, + } +} + +// NewGetAccountDevicesParamsWithContext creates a new GetAccountDevicesParams object +// with the ability to set a context for a request. +func NewGetAccountDevicesParamsWithContext(ctx context.Context) *GetAccountDevicesParams { + return &GetAccountDevicesParams{ + Context: ctx, + } +} + +// NewGetAccountDevicesParamsWithHTTPClient creates a new GetAccountDevicesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAccountDevicesParamsWithHTTPClient(client *http.Client) *GetAccountDevicesParams { + return &GetAccountDevicesParams{ + HTTPClient: client, + } +} + +/* GetAccountDevicesParams contains all the parameters to send to the API endpoint + for the get account devices operation. + + Typically these are written to a http.Request. +*/ +type GetAccountDevicesParams struct { + + // AccountID. + AccountID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get account devices params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountDevicesParams) WithDefaults() *GetAccountDevicesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get account devices params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountDevicesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get account devices params +func (o *GetAccountDevicesParams) WithTimeout(timeout time.Duration) *GetAccountDevicesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get account devices params +func (o *GetAccountDevicesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get account devices params +func (o *GetAccountDevicesParams) WithContext(ctx context.Context) *GetAccountDevicesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get account devices params +func (o *GetAccountDevicesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get account devices params +func (o *GetAccountDevicesParams) WithHTTPClient(client *http.Client) *GetAccountDevicesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get account devices params +func (o *GetAccountDevicesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get account devices params +func (o *GetAccountDevicesParams) WithAccountID(accountID string) *GetAccountDevicesParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get account devices params +func (o *GetAccountDevicesParams) SetAccountID(accountID string) { + o.AccountID = accountID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAccountDevicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param accountId + if err := r.SetPathParam("accountId", o.AccountID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/kazoo/kazoo_client/device/get_account_devices_responses.go b/api/kazoo/kazoo_client/device/get_account_devices_responses.go new file mode 100644 index 0000000..763b296 --- /dev/null +++ b/api/kazoo/kazoo_client/device/get_account_devices_responses.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package device + +// 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/telnexus/lib/api/kazoo/kazoo_models" +) + +// GetAccountDevicesReader is a Reader for the GetAccountDevices structure. +type GetAccountDevicesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAccountDevicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAccountDevicesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetAccountDevicesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetAccountDevicesNotFound() + 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()) + } +} + +// NewGetAccountDevicesOK creates a GetAccountDevicesOK with default headers values +func NewGetAccountDevicesOK() *GetAccountDevicesOK { + return &GetAccountDevicesOK{} +} + +/* GetAccountDevicesOK describes a response with status code 200, with default header values. + +Kazoo response +*/ +type GetAccountDevicesOK struct { + Payload *kazoo_models.GetDeviceResponse +} + +func (o *GetAccountDevicesOK) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/devices][%d] getAccountDevicesOK %+v", 200, o.Payload) +} +func (o *GetAccountDevicesOK) GetPayload() *kazoo_models.GetDeviceResponse { + return o.Payload +} + +func (o *GetAccountDevicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.GetDeviceResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountDevicesUnauthorized creates a GetAccountDevicesUnauthorized with default headers values +func NewGetAccountDevicesUnauthorized() *GetAccountDevicesUnauthorized { + return &GetAccountDevicesUnauthorized{} +} + +/* GetAccountDevicesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetAccountDevicesUnauthorized struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountDevicesUnauthorized) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/devices][%d] getAccountDevicesUnauthorized %+v", 401, o.Payload) +} +func (o *GetAccountDevicesUnauthorized) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountDevicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountDevicesNotFound creates a GetAccountDevicesNotFound with default headers values +func NewGetAccountDevicesNotFound() *GetAccountDevicesNotFound { + return &GetAccountDevicesNotFound{} +} + +/* GetAccountDevicesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetAccountDevicesNotFound struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountDevicesNotFound) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/devices][%d] getAccountDevicesNotFound %+v", 404, o.Payload) +} +func (o *GetAccountDevicesNotFound) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountDevicesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/kazoo/kazoo_client/device/get_user_devices_parameters.go b/api/kazoo/kazoo_client/device/get_user_devices_parameters.go new file mode 100644 index 0000000..4725646 --- /dev/null +++ b/api/kazoo/kazoo_client/device/get_user_devices_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package device + +// 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" +) + +// NewGetUserDevicesParams creates a new GetUserDevicesParams 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 NewGetUserDevicesParams() *GetUserDevicesParams { + return &GetUserDevicesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetUserDevicesParamsWithTimeout creates a new GetUserDevicesParams object +// with the ability to set a timeout on a request. +func NewGetUserDevicesParamsWithTimeout(timeout time.Duration) *GetUserDevicesParams { + return &GetUserDevicesParams{ + timeout: timeout, + } +} + +// NewGetUserDevicesParamsWithContext creates a new GetUserDevicesParams object +// with the ability to set a context for a request. +func NewGetUserDevicesParamsWithContext(ctx context.Context) *GetUserDevicesParams { + return &GetUserDevicesParams{ + Context: ctx, + } +} + +// NewGetUserDevicesParamsWithHTTPClient creates a new GetUserDevicesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetUserDevicesParamsWithHTTPClient(client *http.Client) *GetUserDevicesParams { + return &GetUserDevicesParams{ + HTTPClient: client, + } +} + +/* GetUserDevicesParams contains all the parameters to send to the API endpoint + for the get user devices operation. + + Typically these are written to a http.Request. +*/ +type GetUserDevicesParams struct { + + // AccountID. + AccountID string + + // UserID. + UserID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get user devices params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetUserDevicesParams) WithDefaults() *GetUserDevicesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get user devices params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetUserDevicesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get user devices params +func (o *GetUserDevicesParams) WithTimeout(timeout time.Duration) *GetUserDevicesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get user devices params +func (o *GetUserDevicesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get user devices params +func (o *GetUserDevicesParams) WithContext(ctx context.Context) *GetUserDevicesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get user devices params +func (o *GetUserDevicesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get user devices params +func (o *GetUserDevicesParams) WithHTTPClient(client *http.Client) *GetUserDevicesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get user devices params +func (o *GetUserDevicesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get user devices params +func (o *GetUserDevicesParams) WithAccountID(accountID string) *GetUserDevicesParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get user devices params +func (o *GetUserDevicesParams) SetAccountID(accountID string) { + o.AccountID = accountID +} + +// WithUserID adds the userID to the get user devices params +func (o *GetUserDevicesParams) WithUserID(userID string) *GetUserDevicesParams { + o.SetUserID(userID) + return o +} + +// SetUserID adds the userId to the get user devices params +func (o *GetUserDevicesParams) SetUserID(userID string) { + o.UserID = userID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetUserDevicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param accountId + if err := r.SetPathParam("accountId", o.AccountID); err != nil { + return err + } + + // path param userId + if err := r.SetPathParam("userId", o.UserID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/kazoo/kazoo_client/device/get_user_devices_responses.go b/api/kazoo/kazoo_client/device/get_user_devices_responses.go new file mode 100644 index 0000000..46f7acb --- /dev/null +++ b/api/kazoo/kazoo_client/device/get_user_devices_responses.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package device + +// 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/telnexus/lib/api/kazoo/kazoo_models" +) + +// GetUserDevicesReader is a Reader for the GetUserDevices structure. +type GetUserDevicesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetUserDevicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetUserDevicesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetUserDevicesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetUserDevicesNotFound() + 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()) + } +} + +// NewGetUserDevicesOK creates a GetUserDevicesOK with default headers values +func NewGetUserDevicesOK() *GetUserDevicesOK { + return &GetUserDevicesOK{} +} + +/* GetUserDevicesOK describes a response with status code 200, with default header values. + +Kazoo response +*/ +type GetUserDevicesOK struct { + Payload *kazoo_models.GetDeviceResponse +} + +func (o *GetUserDevicesOK) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/users/{userId}/devices][%d] getUserDevicesOK %+v", 200, o.Payload) +} +func (o *GetUserDevicesOK) GetPayload() *kazoo_models.GetDeviceResponse { + return o.Payload +} + +func (o *GetUserDevicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.GetDeviceResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUserDevicesUnauthorized creates a GetUserDevicesUnauthorized with default headers values +func NewGetUserDevicesUnauthorized() *GetUserDevicesUnauthorized { + return &GetUserDevicesUnauthorized{} +} + +/* GetUserDevicesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetUserDevicesUnauthorized struct { + Payload *kazoo_models.Error +} + +func (o *GetUserDevicesUnauthorized) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/users/{userId}/devices][%d] getUserDevicesUnauthorized %+v", 401, o.Payload) +} +func (o *GetUserDevicesUnauthorized) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetUserDevicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUserDevicesNotFound creates a GetUserDevicesNotFound with default headers values +func NewGetUserDevicesNotFound() *GetUserDevicesNotFound { + return &GetUserDevicesNotFound{} +} + +/* GetUserDevicesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetUserDevicesNotFound struct { + Payload *kazoo_models.Error +} + +func (o *GetUserDevicesNotFound) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/users/{userId}/devices][%d] getUserDevicesNotFound %+v", 404, o.Payload) +} +func (o *GetUserDevicesNotFound) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetUserDevicesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/kazoo/kazoo_client/group/get_account_groups_parameters.go b/api/kazoo/kazoo_client/group/get_account_groups_parameters.go new file mode 100644 index 0000000..f7024d8 --- /dev/null +++ b/api/kazoo/kazoo_client/group/get_account_groups_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package group + +// 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" +) + +// NewGetAccountGroupsParams creates a new GetAccountGroupsParams 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 NewGetAccountGroupsParams() *GetAccountGroupsParams { + return &GetAccountGroupsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAccountGroupsParamsWithTimeout creates a new GetAccountGroupsParams object +// with the ability to set a timeout on a request. +func NewGetAccountGroupsParamsWithTimeout(timeout time.Duration) *GetAccountGroupsParams { + return &GetAccountGroupsParams{ + timeout: timeout, + } +} + +// NewGetAccountGroupsParamsWithContext creates a new GetAccountGroupsParams object +// with the ability to set a context for a request. +func NewGetAccountGroupsParamsWithContext(ctx context.Context) *GetAccountGroupsParams { + return &GetAccountGroupsParams{ + Context: ctx, + } +} + +// NewGetAccountGroupsParamsWithHTTPClient creates a new GetAccountGroupsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAccountGroupsParamsWithHTTPClient(client *http.Client) *GetAccountGroupsParams { + return &GetAccountGroupsParams{ + HTTPClient: client, + } +} + +/* GetAccountGroupsParams contains all the parameters to send to the API endpoint + for the get account groups operation. + + Typically these are written to a http.Request. +*/ +type GetAccountGroupsParams struct { + + // AccountID. + AccountID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get account groups params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountGroupsParams) WithDefaults() *GetAccountGroupsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get account groups params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountGroupsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get account groups params +func (o *GetAccountGroupsParams) WithTimeout(timeout time.Duration) *GetAccountGroupsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get account groups params +func (o *GetAccountGroupsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get account groups params +func (o *GetAccountGroupsParams) WithContext(ctx context.Context) *GetAccountGroupsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get account groups params +func (o *GetAccountGroupsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get account groups params +func (o *GetAccountGroupsParams) WithHTTPClient(client *http.Client) *GetAccountGroupsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get account groups params +func (o *GetAccountGroupsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get account groups params +func (o *GetAccountGroupsParams) WithAccountID(accountID string) *GetAccountGroupsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get account groups params +func (o *GetAccountGroupsParams) SetAccountID(accountID string) { + o.AccountID = accountID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAccountGroupsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param accountId + if err := r.SetPathParam("accountId", o.AccountID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/kazoo/kazoo_client/group/get_account_groups_responses.go b/api/kazoo/kazoo_client/group/get_account_groups_responses.go new file mode 100644 index 0000000..dc7cac6 --- /dev/null +++ b/api/kazoo/kazoo_client/group/get_account_groups_responses.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package group + +// 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/telnexus/lib/api/kazoo/kazoo_models" +) + +// GetAccountGroupsReader is a Reader for the GetAccountGroups structure. +type GetAccountGroupsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAccountGroupsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAccountGroupsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetAccountGroupsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetAccountGroupsNotFound() + 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()) + } +} + +// NewGetAccountGroupsOK creates a GetAccountGroupsOK with default headers values +func NewGetAccountGroupsOK() *GetAccountGroupsOK { + return &GetAccountGroupsOK{} +} + +/* GetAccountGroupsOK describes a response with status code 200, with default header values. + +Kazoo response +*/ +type GetAccountGroupsOK struct { + Payload *kazoo_models.GetAccountGroupResponse +} + +func (o *GetAccountGroupsOK) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/groups][%d] getAccountGroupsOK %+v", 200, o.Payload) +} +func (o *GetAccountGroupsOK) GetPayload() *kazoo_models.GetAccountGroupResponse { + return o.Payload +} + +func (o *GetAccountGroupsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.GetAccountGroupResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountGroupsUnauthorized creates a GetAccountGroupsUnauthorized with default headers values +func NewGetAccountGroupsUnauthorized() *GetAccountGroupsUnauthorized { + return &GetAccountGroupsUnauthorized{} +} + +/* GetAccountGroupsUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetAccountGroupsUnauthorized struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountGroupsUnauthorized) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/groups][%d] getAccountGroupsUnauthorized %+v", 401, o.Payload) +} +func (o *GetAccountGroupsUnauthorized) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountGroupsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountGroupsNotFound creates a GetAccountGroupsNotFound with default headers values +func NewGetAccountGroupsNotFound() *GetAccountGroupsNotFound { + return &GetAccountGroupsNotFound{} +} + +/* GetAccountGroupsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetAccountGroupsNotFound struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountGroupsNotFound) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/groups][%d] getAccountGroupsNotFound %+v", 404, o.Payload) +} +func (o *GetAccountGroupsNotFound) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountGroupsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/kazoo/kazoo_client/group/group_client.go b/api/kazoo/kazoo_client/group/group_client.go new file mode 100644 index 0000000..0cb59f1 --- /dev/null +++ b/api/kazoo/kazoo_client/group/group_client.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package group + +// 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 group API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for group 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 { + GetAccountGroups(params *GetAccountGroupsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountGroupsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetAccountGroups get account groups API +*/ +func (a *Client) GetAccountGroups(params *GetAccountGroupsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountGroupsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAccountGroupsParams() + } + op := &runtime.ClientOperation{ + ID: "getAccountGroups", + Method: "GET", + PathPattern: "/accounts/{accountId}/groups", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetAccountGroupsReader{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.(*GetAccountGroupsOK) + 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 getAccountGroups: 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 +} diff --git a/api/kazoo/kazoo_client/kazoo_client.go b/api/kazoo/kazoo_client/kazoo_client.go new file mode 100644 index 0000000..8a042dc --- /dev/null +++ b/api/kazoo/kazoo_client/kazoo_client.go @@ -0,0 +1,161 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package kazoo_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" + + "code.tnxs.net/telnexus/lib/api/kazoo/kazoo_client/account" + "code.tnxs.net/telnexus/lib/api/kazoo/kazoo_client/call_flow" + "code.tnxs.net/telnexus/lib/api/kazoo/kazoo_client/cdr" + "code.tnxs.net/telnexus/lib/api/kazoo/kazoo_client/device" + "code.tnxs.net/telnexus/lib/api/kazoo/kazoo_client/group" + "code.tnxs.net/telnexus/lib/api/kazoo/kazoo_client/media" + "code.tnxs.net/telnexus/lib/api/kazoo/kazoo_client/menu" + "code.tnxs.net/telnexus/lib/api/kazoo/kazoo_client/phone_number" + "code.tnxs.net/telnexus/lib/api/kazoo/kazoo_client/time_rule" + "code.tnxs.net/telnexus/lib/api/kazoo/kazoo_client/user" +) + +// Default kazoo HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "api.zswitch.net:8443" + // DefaultBasePath is the default BasePath + // found in Meta (info) section of spec file + DefaultBasePath string = "/v2" +) + +// DefaultSchemes are the default schemes found in Meta (info) section of spec file +var DefaultSchemes = []string{"https"} + +// NewHTTPClient creates a new kazoo HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Kazoo { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new kazoo HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Kazoo { + // ensure nullable parameters have default + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new kazoo client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Kazoo { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Kazoo) + cli.Transport = transport + cli.Account = account.New(transport, formats) + cli.CallFlow = call_flow.New(transport, formats) + cli.Cdr = cdr.New(transport, formats) + cli.Device = device.New(transport, formats) + cli.Group = group.New(transport, formats) + cli.Media = media.New(transport, formats) + cli.Menu = menu.New(transport, formats) + cli.PhoneNumber = phone_number.New(transport, formats) + cli.TimeRule = time_rule.New(transport, formats) + cli.User = user.New(transport, formats) + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// Kazoo is a client for kazoo +type Kazoo struct { + Account account.ClientService + + CallFlow call_flow.ClientService + + Cdr cdr.ClientService + + Device device.ClientService + + Group group.ClientService + + Media media.ClientService + + Menu menu.ClientService + + PhoneNumber phone_number.ClientService + + TimeRule time_rule.ClientService + + User user.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Kazoo) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.Account.SetTransport(transport) + c.CallFlow.SetTransport(transport) + c.Cdr.SetTransport(transport) + c.Device.SetTransport(transport) + c.Group.SetTransport(transport) + c.Media.SetTransport(transport) + c.Menu.SetTransport(transport) + c.PhoneNumber.SetTransport(transport) + c.TimeRule.SetTransport(transport) + c.User.SetTransport(transport) +} diff --git a/api/kazoo/kazoo_client/media/get_account_media_parameters.go b/api/kazoo/kazoo_client/media/get_account_media_parameters.go new file mode 100644 index 0000000..e49da17 --- /dev/null +++ b/api/kazoo/kazoo_client/media/get_account_media_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package media + +// 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" +) + +// NewGetAccountMediaParams creates a new GetAccountMediaParams 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 NewGetAccountMediaParams() *GetAccountMediaParams { + return &GetAccountMediaParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAccountMediaParamsWithTimeout creates a new GetAccountMediaParams object +// with the ability to set a timeout on a request. +func NewGetAccountMediaParamsWithTimeout(timeout time.Duration) *GetAccountMediaParams { + return &GetAccountMediaParams{ + timeout: timeout, + } +} + +// NewGetAccountMediaParamsWithContext creates a new GetAccountMediaParams object +// with the ability to set a context for a request. +func NewGetAccountMediaParamsWithContext(ctx context.Context) *GetAccountMediaParams { + return &GetAccountMediaParams{ + Context: ctx, + } +} + +// NewGetAccountMediaParamsWithHTTPClient creates a new GetAccountMediaParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAccountMediaParamsWithHTTPClient(client *http.Client) *GetAccountMediaParams { + return &GetAccountMediaParams{ + HTTPClient: client, + } +} + +/* GetAccountMediaParams contains all the parameters to send to the API endpoint + for the get account media operation. + + Typically these are written to a http.Request. +*/ +type GetAccountMediaParams struct { + + // AccountID. + AccountID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get account media params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountMediaParams) WithDefaults() *GetAccountMediaParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get account media params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountMediaParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get account media params +func (o *GetAccountMediaParams) WithTimeout(timeout time.Duration) *GetAccountMediaParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get account media params +func (o *GetAccountMediaParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get account media params +func (o *GetAccountMediaParams) WithContext(ctx context.Context) *GetAccountMediaParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get account media params +func (o *GetAccountMediaParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get account media params +func (o *GetAccountMediaParams) WithHTTPClient(client *http.Client) *GetAccountMediaParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get account media params +func (o *GetAccountMediaParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get account media params +func (o *GetAccountMediaParams) WithAccountID(accountID string) *GetAccountMediaParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get account media params +func (o *GetAccountMediaParams) SetAccountID(accountID string) { + o.AccountID = accountID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAccountMediaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param accountId + if err := r.SetPathParam("accountId", o.AccountID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/kazoo/kazoo_client/media/get_account_media_responses.go b/api/kazoo/kazoo_client/media/get_account_media_responses.go new file mode 100644 index 0000000..ff26b6c --- /dev/null +++ b/api/kazoo/kazoo_client/media/get_account_media_responses.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package media + +// 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/telnexus/lib/api/kazoo/kazoo_models" +) + +// GetAccountMediaReader is a Reader for the GetAccountMedia structure. +type GetAccountMediaReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAccountMediaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAccountMediaOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetAccountMediaUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetAccountMediaNotFound() + 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()) + } +} + +// NewGetAccountMediaOK creates a GetAccountMediaOK with default headers values +func NewGetAccountMediaOK() *GetAccountMediaOK { + return &GetAccountMediaOK{} +} + +/* GetAccountMediaOK describes a response with status code 200, with default header values. + +Kazoo response +*/ +type GetAccountMediaOK struct { + Payload *kazoo_models.GetAccountMediaResponse +} + +func (o *GetAccountMediaOK) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/media][%d] getAccountMediaOK %+v", 200, o.Payload) +} +func (o *GetAccountMediaOK) GetPayload() *kazoo_models.GetAccountMediaResponse { + return o.Payload +} + +func (o *GetAccountMediaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.GetAccountMediaResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountMediaUnauthorized creates a GetAccountMediaUnauthorized with default headers values +func NewGetAccountMediaUnauthorized() *GetAccountMediaUnauthorized { + return &GetAccountMediaUnauthorized{} +} + +/* GetAccountMediaUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetAccountMediaUnauthorized struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountMediaUnauthorized) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/media][%d] getAccountMediaUnauthorized %+v", 401, o.Payload) +} +func (o *GetAccountMediaUnauthorized) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountMediaUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountMediaNotFound creates a GetAccountMediaNotFound with default headers values +func NewGetAccountMediaNotFound() *GetAccountMediaNotFound { + return &GetAccountMediaNotFound{} +} + +/* GetAccountMediaNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetAccountMediaNotFound struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountMediaNotFound) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/media][%d] getAccountMediaNotFound %+v", 404, o.Payload) +} +func (o *GetAccountMediaNotFound) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountMediaNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/kazoo/kazoo_client/media/media_client.go b/api/kazoo/kazoo_client/media/media_client.go new file mode 100644 index 0000000..053d18e --- /dev/null +++ b/api/kazoo/kazoo_client/media/media_client.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package media + +// 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 media API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for media 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 { + GetAccountMedia(params *GetAccountMediaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountMediaOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetAccountMedia get account media API +*/ +func (a *Client) GetAccountMedia(params *GetAccountMediaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountMediaOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAccountMediaParams() + } + op := &runtime.ClientOperation{ + ID: "getAccountMedia", + Method: "GET", + PathPattern: "/accounts/{accountId}/media", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetAccountMediaReader{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.(*GetAccountMediaOK) + 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 getAccountMedia: 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 +} diff --git a/api/kazoo/kazoo_client/menu/get_account_menus_parameters.go b/api/kazoo/kazoo_client/menu/get_account_menus_parameters.go new file mode 100644 index 0000000..59cdfaa --- /dev/null +++ b/api/kazoo/kazoo_client/menu/get_account_menus_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package menu + +// 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" +) + +// NewGetAccountMenusParams creates a new GetAccountMenusParams 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 NewGetAccountMenusParams() *GetAccountMenusParams { + return &GetAccountMenusParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAccountMenusParamsWithTimeout creates a new GetAccountMenusParams object +// with the ability to set a timeout on a request. +func NewGetAccountMenusParamsWithTimeout(timeout time.Duration) *GetAccountMenusParams { + return &GetAccountMenusParams{ + timeout: timeout, + } +} + +// NewGetAccountMenusParamsWithContext creates a new GetAccountMenusParams object +// with the ability to set a context for a request. +func NewGetAccountMenusParamsWithContext(ctx context.Context) *GetAccountMenusParams { + return &GetAccountMenusParams{ + Context: ctx, + } +} + +// NewGetAccountMenusParamsWithHTTPClient creates a new GetAccountMenusParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAccountMenusParamsWithHTTPClient(client *http.Client) *GetAccountMenusParams { + return &GetAccountMenusParams{ + HTTPClient: client, + } +} + +/* GetAccountMenusParams contains all the parameters to send to the API endpoint + for the get account menus operation. + + Typically these are written to a http.Request. +*/ +type GetAccountMenusParams struct { + + // AccountID. + AccountID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get account menus params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountMenusParams) WithDefaults() *GetAccountMenusParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get account menus params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountMenusParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get account menus params +func (o *GetAccountMenusParams) WithTimeout(timeout time.Duration) *GetAccountMenusParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get account menus params +func (o *GetAccountMenusParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get account menus params +func (o *GetAccountMenusParams) WithContext(ctx context.Context) *GetAccountMenusParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get account menus params +func (o *GetAccountMenusParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get account menus params +func (o *GetAccountMenusParams) WithHTTPClient(client *http.Client) *GetAccountMenusParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get account menus params +func (o *GetAccountMenusParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get account menus params +func (o *GetAccountMenusParams) WithAccountID(accountID string) *GetAccountMenusParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get account menus params +func (o *GetAccountMenusParams) SetAccountID(accountID string) { + o.AccountID = accountID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAccountMenusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param accountId + if err := r.SetPathParam("accountId", o.AccountID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/kazoo/kazoo_client/menu/get_account_menus_responses.go b/api/kazoo/kazoo_client/menu/get_account_menus_responses.go new file mode 100644 index 0000000..9dca152 --- /dev/null +++ b/api/kazoo/kazoo_client/menu/get_account_menus_responses.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package menu + +// 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/telnexus/lib/api/kazoo/kazoo_models" +) + +// GetAccountMenusReader is a Reader for the GetAccountMenus structure. +type GetAccountMenusReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAccountMenusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAccountMenusOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetAccountMenusUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetAccountMenusNotFound() + 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()) + } +} + +// NewGetAccountMenusOK creates a GetAccountMenusOK with default headers values +func NewGetAccountMenusOK() *GetAccountMenusOK { + return &GetAccountMenusOK{} +} + +/* GetAccountMenusOK describes a response with status code 200, with default header values. + +Kazoo response +*/ +type GetAccountMenusOK struct { + Payload *kazoo_models.GetAccountMenusResponse +} + +func (o *GetAccountMenusOK) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/menus][%d] getAccountMenusOK %+v", 200, o.Payload) +} +func (o *GetAccountMenusOK) GetPayload() *kazoo_models.GetAccountMenusResponse { + return o.Payload +} + +func (o *GetAccountMenusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.GetAccountMenusResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountMenusUnauthorized creates a GetAccountMenusUnauthorized with default headers values +func NewGetAccountMenusUnauthorized() *GetAccountMenusUnauthorized { + return &GetAccountMenusUnauthorized{} +} + +/* GetAccountMenusUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetAccountMenusUnauthorized struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountMenusUnauthorized) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/menus][%d] getAccountMenusUnauthorized %+v", 401, o.Payload) +} +func (o *GetAccountMenusUnauthorized) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountMenusUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountMenusNotFound creates a GetAccountMenusNotFound with default headers values +func NewGetAccountMenusNotFound() *GetAccountMenusNotFound { + return &GetAccountMenusNotFound{} +} + +/* GetAccountMenusNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetAccountMenusNotFound struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountMenusNotFound) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/menus][%d] getAccountMenusNotFound %+v", 404, o.Payload) +} +func (o *GetAccountMenusNotFound) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountMenusNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/kazoo/kazoo_client/menu/menu_client.go b/api/kazoo/kazoo_client/menu/menu_client.go new file mode 100644 index 0000000..db78ebe --- /dev/null +++ b/api/kazoo/kazoo_client/menu/menu_client.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package menu + +// 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 menu API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for menu 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 { + GetAccountMenus(params *GetAccountMenusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountMenusOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetAccountMenus get account menus API +*/ +func (a *Client) GetAccountMenus(params *GetAccountMenusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountMenusOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAccountMenusParams() + } + op := &runtime.ClientOperation{ + ID: "getAccountMenus", + Method: "GET", + PathPattern: "/accounts/{accountId}/menus", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetAccountMenusReader{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.(*GetAccountMenusOK) + 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 getAccountMenus: 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 +} diff --git a/api/kazoo/kazoo_client/phone_number/get_account_numbers_parameters.go b/api/kazoo/kazoo_client/phone_number/get_account_numbers_parameters.go new file mode 100644 index 0000000..02e2f2c --- /dev/null +++ b/api/kazoo/kazoo_client/phone_number/get_account_numbers_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package phone_number + +// 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" +) + +// NewGetAccountNumbersParams creates a new GetAccountNumbersParams 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 NewGetAccountNumbersParams() *GetAccountNumbersParams { + return &GetAccountNumbersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAccountNumbersParamsWithTimeout creates a new GetAccountNumbersParams object +// with the ability to set a timeout on a request. +func NewGetAccountNumbersParamsWithTimeout(timeout time.Duration) *GetAccountNumbersParams { + return &GetAccountNumbersParams{ + timeout: timeout, + } +} + +// NewGetAccountNumbersParamsWithContext creates a new GetAccountNumbersParams object +// with the ability to set a context for a request. +func NewGetAccountNumbersParamsWithContext(ctx context.Context) *GetAccountNumbersParams { + return &GetAccountNumbersParams{ + Context: ctx, + } +} + +// NewGetAccountNumbersParamsWithHTTPClient creates a new GetAccountNumbersParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAccountNumbersParamsWithHTTPClient(client *http.Client) *GetAccountNumbersParams { + return &GetAccountNumbersParams{ + HTTPClient: client, + } +} + +/* GetAccountNumbersParams contains all the parameters to send to the API endpoint + for the get account numbers operation. + + Typically these are written to a http.Request. +*/ +type GetAccountNumbersParams struct { + + // AccountID. + AccountID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get account numbers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountNumbersParams) WithDefaults() *GetAccountNumbersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get account numbers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountNumbersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get account numbers params +func (o *GetAccountNumbersParams) WithTimeout(timeout time.Duration) *GetAccountNumbersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get account numbers params +func (o *GetAccountNumbersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get account numbers params +func (o *GetAccountNumbersParams) WithContext(ctx context.Context) *GetAccountNumbersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get account numbers params +func (o *GetAccountNumbersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get account numbers params +func (o *GetAccountNumbersParams) WithHTTPClient(client *http.Client) *GetAccountNumbersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get account numbers params +func (o *GetAccountNumbersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get account numbers params +func (o *GetAccountNumbersParams) WithAccountID(accountID string) *GetAccountNumbersParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get account numbers params +func (o *GetAccountNumbersParams) SetAccountID(accountID string) { + o.AccountID = accountID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAccountNumbersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param accountId + if err := r.SetPathParam("accountId", o.AccountID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/kazoo/kazoo_client/phone_number/get_account_numbers_responses.go b/api/kazoo/kazoo_client/phone_number/get_account_numbers_responses.go new file mode 100644 index 0000000..59e2be2 --- /dev/null +++ b/api/kazoo/kazoo_client/phone_number/get_account_numbers_responses.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package phone_number + +// 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/telnexus/lib/api/kazoo/kazoo_models" +) + +// GetAccountNumbersReader is a Reader for the GetAccountNumbers structure. +type GetAccountNumbersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAccountNumbersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAccountNumbersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetAccountNumbersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetAccountNumbersNotFound() + 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()) + } +} + +// NewGetAccountNumbersOK creates a GetAccountNumbersOK with default headers values +func NewGetAccountNumbersOK() *GetAccountNumbersOK { + return &GetAccountNumbersOK{} +} + +/* GetAccountNumbersOK describes a response with status code 200, with default header values. + +Kazoo response +*/ +type GetAccountNumbersOK struct { + Payload *kazoo_models.GetNumberResponse +} + +func (o *GetAccountNumbersOK) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/phone_numebers][%d] getAccountNumbersOK %+v", 200, o.Payload) +} +func (o *GetAccountNumbersOK) GetPayload() *kazoo_models.GetNumberResponse { + return o.Payload +} + +func (o *GetAccountNumbersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.GetNumberResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountNumbersUnauthorized creates a GetAccountNumbersUnauthorized with default headers values +func NewGetAccountNumbersUnauthorized() *GetAccountNumbersUnauthorized { + return &GetAccountNumbersUnauthorized{} +} + +/* GetAccountNumbersUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetAccountNumbersUnauthorized struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountNumbersUnauthorized) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/phone_numebers][%d] getAccountNumbersUnauthorized %+v", 401, o.Payload) +} +func (o *GetAccountNumbersUnauthorized) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountNumbersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountNumbersNotFound creates a GetAccountNumbersNotFound with default headers values +func NewGetAccountNumbersNotFound() *GetAccountNumbersNotFound { + return &GetAccountNumbersNotFound{} +} + +/* GetAccountNumbersNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetAccountNumbersNotFound struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountNumbersNotFound) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/phone_numebers][%d] getAccountNumbersNotFound %+v", 404, o.Payload) +} +func (o *GetAccountNumbersNotFound) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountNumbersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/kazoo/kazoo_client/phone_number/get_kazoo_numbers_parameters.go b/api/kazoo/kazoo_client/phone_number/get_kazoo_numbers_parameters.go new file mode 100644 index 0000000..086f0c3 --- /dev/null +++ b/api/kazoo/kazoo_client/phone_number/get_kazoo_numbers_parameters.go @@ -0,0 +1,198 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package phone_number + +// 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" +) + +// NewGetKazooNumbersParams creates a new GetKazooNumbersParams 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 NewGetKazooNumbersParams() *GetKazooNumbersParams { + return &GetKazooNumbersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetKazooNumbersParamsWithTimeout creates a new GetKazooNumbersParams object +// with the ability to set a timeout on a request. +func NewGetKazooNumbersParamsWithTimeout(timeout time.Duration) *GetKazooNumbersParams { + return &GetKazooNumbersParams{ + timeout: timeout, + } +} + +// NewGetKazooNumbersParamsWithContext creates a new GetKazooNumbersParams object +// with the ability to set a context for a request. +func NewGetKazooNumbersParamsWithContext(ctx context.Context) *GetKazooNumbersParams { + return &GetKazooNumbersParams{ + Context: ctx, + } +} + +// NewGetKazooNumbersParamsWithHTTPClient creates a new GetKazooNumbersParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetKazooNumbersParamsWithHTTPClient(client *http.Client) *GetKazooNumbersParams { + return &GetKazooNumbersParams{ + HTTPClient: client, + } +} + +/* GetKazooNumbersParams contains all the parameters to send to the API endpoint + for the get kazoo numbers operation. + + Typically these are written to a http.Request. +*/ +type GetKazooNumbersParams struct { + + // Prefix. + // + // Format: int32 + Prefix *int32 + + // Quantity. + // + // Format: int32 + Quantity *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get kazoo numbers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetKazooNumbersParams) WithDefaults() *GetKazooNumbersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get kazoo numbers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetKazooNumbersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get kazoo numbers params +func (o *GetKazooNumbersParams) WithTimeout(timeout time.Duration) *GetKazooNumbersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get kazoo numbers params +func (o *GetKazooNumbersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get kazoo numbers params +func (o *GetKazooNumbersParams) WithContext(ctx context.Context) *GetKazooNumbersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get kazoo numbers params +func (o *GetKazooNumbersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get kazoo numbers params +func (o *GetKazooNumbersParams) WithHTTPClient(client *http.Client) *GetKazooNumbersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get kazoo numbers params +func (o *GetKazooNumbersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPrefix adds the prefix to the get kazoo numbers params +func (o *GetKazooNumbersParams) WithPrefix(prefix *int32) *GetKazooNumbersParams { + o.SetPrefix(prefix) + return o +} + +// SetPrefix adds the prefix to the get kazoo numbers params +func (o *GetKazooNumbersParams) SetPrefix(prefix *int32) { + o.Prefix = prefix +} + +// WithQuantity adds the quantity to the get kazoo numbers params +func (o *GetKazooNumbersParams) WithQuantity(quantity *int32) *GetKazooNumbersParams { + o.SetQuantity(quantity) + return o +} + +// SetQuantity adds the quantity to the get kazoo numbers params +func (o *GetKazooNumbersParams) SetQuantity(quantity *int32) { + o.Quantity = quantity +} + +// WriteToRequest writes these params to a swagger request +func (o *GetKazooNumbersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Prefix != nil { + + // query param prefix + var qrPrefix int32 + + if o.Prefix != nil { + qrPrefix = *o.Prefix + } + qPrefix := swag.FormatInt32(qrPrefix) + if qPrefix != "" { + + if err := r.SetQueryParam("prefix", qPrefix); err != nil { + return err + } + } + } + + if o.Quantity != nil { + + // query param quantity + var qrQuantity int32 + + if o.Quantity != nil { + qrQuantity = *o.Quantity + } + qQuantity := swag.FormatInt32(qrQuantity) + if qQuantity != "" { + + if err := r.SetQueryParam("quantity", qQuantity); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/kazoo/kazoo_client/phone_number/get_kazoo_numbers_responses.go b/api/kazoo/kazoo_client/phone_number/get_kazoo_numbers_responses.go new file mode 100644 index 0000000..e3230f3 --- /dev/null +++ b/api/kazoo/kazoo_client/phone_number/get_kazoo_numbers_responses.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package phone_number + +// 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/telnexus/lib/api/kazoo/kazoo_models" +) + +// GetKazooNumbersReader is a Reader for the GetKazooNumbers structure. +type GetKazooNumbersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetKazooNumbersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetKazooNumbersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetKazooNumbersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetKazooNumbersNotFound() + 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()) + } +} + +// NewGetKazooNumbersOK creates a GetKazooNumbersOK with default headers values +func NewGetKazooNumbersOK() *GetKazooNumbersOK { + return &GetKazooNumbersOK{} +} + +/* GetKazooNumbersOK describes a response with status code 200, with default header values. + +Kazoo response +*/ +type GetKazooNumbersOK struct { + Payload *kazoo_models.GetKazooNumberResponse +} + +func (o *GetKazooNumbersOK) Error() string { + return fmt.Sprintf("[GET /phone_numebers][%d] getKazooNumbersOK %+v", 200, o.Payload) +} +func (o *GetKazooNumbersOK) GetPayload() *kazoo_models.GetKazooNumberResponse { + return o.Payload +} + +func (o *GetKazooNumbersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.GetKazooNumberResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetKazooNumbersUnauthorized creates a GetKazooNumbersUnauthorized with default headers values +func NewGetKazooNumbersUnauthorized() *GetKazooNumbersUnauthorized { + return &GetKazooNumbersUnauthorized{} +} + +/* GetKazooNumbersUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetKazooNumbersUnauthorized struct { + Payload *kazoo_models.Error +} + +func (o *GetKazooNumbersUnauthorized) Error() string { + return fmt.Sprintf("[GET /phone_numebers][%d] getKazooNumbersUnauthorized %+v", 401, o.Payload) +} +func (o *GetKazooNumbersUnauthorized) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetKazooNumbersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetKazooNumbersNotFound creates a GetKazooNumbersNotFound with default headers values +func NewGetKazooNumbersNotFound() *GetKazooNumbersNotFound { + return &GetKazooNumbersNotFound{} +} + +/* GetKazooNumbersNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetKazooNumbersNotFound struct { + Payload *kazoo_models.Error +} + +func (o *GetKazooNumbersNotFound) Error() string { + return fmt.Sprintf("[GET /phone_numebers][%d] getKazooNumbersNotFound %+v", 404, o.Payload) +} +func (o *GetKazooNumbersNotFound) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetKazooNumbersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/kazoo/kazoo_client/phone_number/phone_number_client.go b/api/kazoo/kazoo_client/phone_number/phone_number_client.go new file mode 100644 index 0000000..86b10d2 --- /dev/null +++ b/api/kazoo/kazoo_client/phone_number/phone_number_client.go @@ -0,0 +1,125 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package phone_number + +// 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 phone number API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for phone number 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 { + GetAccountNumbers(params *GetAccountNumbersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountNumbersOK, error) + + GetKazooNumbers(params *GetKazooNumbersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetKazooNumbersOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetAccountNumbers get account numbers API +*/ +func (a *Client) GetAccountNumbers(params *GetAccountNumbersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountNumbersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAccountNumbersParams() + } + op := &runtime.ClientOperation{ + ID: "getAccountNumbers", + Method: "GET", + PathPattern: "/accounts/{accountId}/phone_numebers", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetAccountNumbersReader{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.(*GetAccountNumbersOK) + 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 getAccountNumbers: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetKazooNumbers get kazoo numbers API +*/ +func (a *Client) GetKazooNumbers(params *GetKazooNumbersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetKazooNumbersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetKazooNumbersParams() + } + op := &runtime.ClientOperation{ + ID: "getKazooNumbers", + Method: "GET", + PathPattern: "/phone_numebers", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetKazooNumbersReader{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.(*GetKazooNumbersOK) + 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 getKazooNumbers: 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 +} diff --git a/api/kazoo/kazoo_client/time_rule/get_account_time_rules_parameters.go b/api/kazoo/kazoo_client/time_rule/get_account_time_rules_parameters.go new file mode 100644 index 0000000..dbb3f64 --- /dev/null +++ b/api/kazoo/kazoo_client/time_rule/get_account_time_rules_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package time_rule + +// 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" +) + +// NewGetAccountTimeRulesParams creates a new GetAccountTimeRulesParams 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 NewGetAccountTimeRulesParams() *GetAccountTimeRulesParams { + return &GetAccountTimeRulesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAccountTimeRulesParamsWithTimeout creates a new GetAccountTimeRulesParams object +// with the ability to set a timeout on a request. +func NewGetAccountTimeRulesParamsWithTimeout(timeout time.Duration) *GetAccountTimeRulesParams { + return &GetAccountTimeRulesParams{ + timeout: timeout, + } +} + +// NewGetAccountTimeRulesParamsWithContext creates a new GetAccountTimeRulesParams object +// with the ability to set a context for a request. +func NewGetAccountTimeRulesParamsWithContext(ctx context.Context) *GetAccountTimeRulesParams { + return &GetAccountTimeRulesParams{ + Context: ctx, + } +} + +// NewGetAccountTimeRulesParamsWithHTTPClient creates a new GetAccountTimeRulesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAccountTimeRulesParamsWithHTTPClient(client *http.Client) *GetAccountTimeRulesParams { + return &GetAccountTimeRulesParams{ + HTTPClient: client, + } +} + +/* GetAccountTimeRulesParams contains all the parameters to send to the API endpoint + for the get account time rules operation. + + Typically these are written to a http.Request. +*/ +type GetAccountTimeRulesParams struct { + + // AccountID. + AccountID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get account time rules params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountTimeRulesParams) WithDefaults() *GetAccountTimeRulesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get account time rules params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountTimeRulesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get account time rules params +func (o *GetAccountTimeRulesParams) WithTimeout(timeout time.Duration) *GetAccountTimeRulesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get account time rules params +func (o *GetAccountTimeRulesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get account time rules params +func (o *GetAccountTimeRulesParams) WithContext(ctx context.Context) *GetAccountTimeRulesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get account time rules params +func (o *GetAccountTimeRulesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get account time rules params +func (o *GetAccountTimeRulesParams) WithHTTPClient(client *http.Client) *GetAccountTimeRulesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get account time rules params +func (o *GetAccountTimeRulesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get account time rules params +func (o *GetAccountTimeRulesParams) WithAccountID(accountID string) *GetAccountTimeRulesParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get account time rules params +func (o *GetAccountTimeRulesParams) SetAccountID(accountID string) { + o.AccountID = accountID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAccountTimeRulesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param accountId + if err := r.SetPathParam("accountId", o.AccountID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/kazoo/kazoo_client/time_rule/get_account_time_rules_responses.go b/api/kazoo/kazoo_client/time_rule/get_account_time_rules_responses.go new file mode 100644 index 0000000..20a8bde --- /dev/null +++ b/api/kazoo/kazoo_client/time_rule/get_account_time_rules_responses.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package time_rule + +// 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/telnexus/lib/api/kazoo/kazoo_models" +) + +// GetAccountTimeRulesReader is a Reader for the GetAccountTimeRules structure. +type GetAccountTimeRulesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAccountTimeRulesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAccountTimeRulesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetAccountTimeRulesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetAccountTimeRulesNotFound() + 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()) + } +} + +// NewGetAccountTimeRulesOK creates a GetAccountTimeRulesOK with default headers values +func NewGetAccountTimeRulesOK() *GetAccountTimeRulesOK { + return &GetAccountTimeRulesOK{} +} + +/* GetAccountTimeRulesOK describes a response with status code 200, with default header values. + +Kazoo response +*/ +type GetAccountTimeRulesOK struct { + Payload *kazoo_models.GetAccountTimeRuleResponse +} + +func (o *GetAccountTimeRulesOK) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/temporal_rules][%d] getAccountTimeRulesOK %+v", 200, o.Payload) +} +func (o *GetAccountTimeRulesOK) GetPayload() *kazoo_models.GetAccountTimeRuleResponse { + return o.Payload +} + +func (o *GetAccountTimeRulesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.GetAccountTimeRuleResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountTimeRulesUnauthorized creates a GetAccountTimeRulesUnauthorized with default headers values +func NewGetAccountTimeRulesUnauthorized() *GetAccountTimeRulesUnauthorized { + return &GetAccountTimeRulesUnauthorized{} +} + +/* GetAccountTimeRulesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetAccountTimeRulesUnauthorized struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountTimeRulesUnauthorized) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/temporal_rules][%d] getAccountTimeRulesUnauthorized %+v", 401, o.Payload) +} +func (o *GetAccountTimeRulesUnauthorized) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountTimeRulesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountTimeRulesNotFound creates a GetAccountTimeRulesNotFound with default headers values +func NewGetAccountTimeRulesNotFound() *GetAccountTimeRulesNotFound { + return &GetAccountTimeRulesNotFound{} +} + +/* GetAccountTimeRulesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetAccountTimeRulesNotFound struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountTimeRulesNotFound) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/temporal_rules][%d] getAccountTimeRulesNotFound %+v", 404, o.Payload) +} +func (o *GetAccountTimeRulesNotFound) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountTimeRulesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/kazoo/kazoo_client/time_rule/time_rule_client.go b/api/kazoo/kazoo_client/time_rule/time_rule_client.go new file mode 100644 index 0000000..96522cd --- /dev/null +++ b/api/kazoo/kazoo_client/time_rule/time_rule_client.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package time_rule + +// 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 time rule API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for time rule 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 { + GetAccountTimeRules(params *GetAccountTimeRulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountTimeRulesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetAccountTimeRules get account time rules API +*/ +func (a *Client) GetAccountTimeRules(params *GetAccountTimeRulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountTimeRulesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAccountTimeRulesParams() + } + op := &runtime.ClientOperation{ + ID: "getAccountTimeRules", + Method: "GET", + PathPattern: "/accounts/{accountId}/temporal_rules", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetAccountTimeRulesReader{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.(*GetAccountTimeRulesOK) + 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 getAccountTimeRules: 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 +} diff --git a/api/kazoo/kazoo_client/user/get_account_users_parameters.go b/api/kazoo/kazoo_client/user/get_account_users_parameters.go new file mode 100644 index 0000000..50bada6 --- /dev/null +++ b/api/kazoo/kazoo_client/user/get_account_users_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetAccountUsersParams creates a new GetAccountUsersParams 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 NewGetAccountUsersParams() *GetAccountUsersParams { + return &GetAccountUsersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAccountUsersParamsWithTimeout creates a new GetAccountUsersParams object +// with the ability to set a timeout on a request. +func NewGetAccountUsersParamsWithTimeout(timeout time.Duration) *GetAccountUsersParams { + return &GetAccountUsersParams{ + timeout: timeout, + } +} + +// NewGetAccountUsersParamsWithContext creates a new GetAccountUsersParams object +// with the ability to set a context for a request. +func NewGetAccountUsersParamsWithContext(ctx context.Context) *GetAccountUsersParams { + return &GetAccountUsersParams{ + Context: ctx, + } +} + +// NewGetAccountUsersParamsWithHTTPClient creates a new GetAccountUsersParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAccountUsersParamsWithHTTPClient(client *http.Client) *GetAccountUsersParams { + return &GetAccountUsersParams{ + HTTPClient: client, + } +} + +/* GetAccountUsersParams contains all the parameters to send to the API endpoint + for the get account users operation. + + Typically these are written to a http.Request. +*/ +type GetAccountUsersParams struct { + + // AccountID. + AccountID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get account users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountUsersParams) WithDefaults() *GetAccountUsersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get account users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountUsersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get account users params +func (o *GetAccountUsersParams) WithTimeout(timeout time.Duration) *GetAccountUsersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get account users params +func (o *GetAccountUsersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get account users params +func (o *GetAccountUsersParams) WithContext(ctx context.Context) *GetAccountUsersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get account users params +func (o *GetAccountUsersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get account users params +func (o *GetAccountUsersParams) WithHTTPClient(client *http.Client) *GetAccountUsersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get account users params +func (o *GetAccountUsersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get account users params +func (o *GetAccountUsersParams) WithAccountID(accountID string) *GetAccountUsersParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get account users params +func (o *GetAccountUsersParams) SetAccountID(accountID string) { + o.AccountID = accountID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAccountUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param accountId + if err := r.SetPathParam("accountId", o.AccountID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/kazoo/kazoo_client/user/get_account_users_responses.go b/api/kazoo/kazoo_client/user/get_account_users_responses.go new file mode 100644 index 0000000..34fbe58 --- /dev/null +++ b/api/kazoo/kazoo_client/user/get_account_users_responses.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/kazoo/kazoo_models" +) + +// GetAccountUsersReader is a Reader for the GetAccountUsers structure. +type GetAccountUsersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAccountUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAccountUsersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetAccountUsersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetAccountUsersNotFound() + 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()) + } +} + +// NewGetAccountUsersOK creates a GetAccountUsersOK with default headers values +func NewGetAccountUsersOK() *GetAccountUsersOK { + return &GetAccountUsersOK{} +} + +/* GetAccountUsersOK describes a response with status code 200, with default header values. + +Kazoo response +*/ +type GetAccountUsersOK struct { + Payload *kazoo_models.GetAccountUserResponse +} + +func (o *GetAccountUsersOK) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/users][%d] getAccountUsersOK %+v", 200, o.Payload) +} +func (o *GetAccountUsersOK) GetPayload() *kazoo_models.GetAccountUserResponse { + return o.Payload +} + +func (o *GetAccountUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.GetAccountUserResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountUsersUnauthorized creates a GetAccountUsersUnauthorized with default headers values +func NewGetAccountUsersUnauthorized() *GetAccountUsersUnauthorized { + return &GetAccountUsersUnauthorized{} +} + +/* GetAccountUsersUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetAccountUsersUnauthorized struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountUsersUnauthorized) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/users][%d] getAccountUsersUnauthorized %+v", 401, o.Payload) +} +func (o *GetAccountUsersUnauthorized) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountUsersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountUsersNotFound creates a GetAccountUsersNotFound with default headers values +func NewGetAccountUsersNotFound() *GetAccountUsersNotFound { + return &GetAccountUsersNotFound{} +} + +/* GetAccountUsersNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetAccountUsersNotFound struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountUsersNotFound) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/users][%d] getAccountUsersNotFound %+v", 404, o.Payload) +} +func (o *GetAccountUsersNotFound) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountUsersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/kazoo/kazoo_client/user/get_account_vm_boxes_parameters.go b/api/kazoo/kazoo_client/user/get_account_vm_boxes_parameters.go new file mode 100644 index 0000000..037b40e --- /dev/null +++ b/api/kazoo/kazoo_client/user/get_account_vm_boxes_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetAccountVMBoxesParams creates a new GetAccountVMBoxesParams 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 NewGetAccountVMBoxesParams() *GetAccountVMBoxesParams { + return &GetAccountVMBoxesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAccountVMBoxesParamsWithTimeout creates a new GetAccountVMBoxesParams object +// with the ability to set a timeout on a request. +func NewGetAccountVMBoxesParamsWithTimeout(timeout time.Duration) *GetAccountVMBoxesParams { + return &GetAccountVMBoxesParams{ + timeout: timeout, + } +} + +// NewGetAccountVMBoxesParamsWithContext creates a new GetAccountVMBoxesParams object +// with the ability to set a context for a request. +func NewGetAccountVMBoxesParamsWithContext(ctx context.Context) *GetAccountVMBoxesParams { + return &GetAccountVMBoxesParams{ + Context: ctx, + } +} + +// NewGetAccountVMBoxesParamsWithHTTPClient creates a new GetAccountVMBoxesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAccountVMBoxesParamsWithHTTPClient(client *http.Client) *GetAccountVMBoxesParams { + return &GetAccountVMBoxesParams{ + HTTPClient: client, + } +} + +/* GetAccountVMBoxesParams contains all the parameters to send to the API endpoint + for the get account Vm boxes operation. + + Typically these are written to a http.Request. +*/ +type GetAccountVMBoxesParams struct { + + // AccountID. + AccountID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get account Vm boxes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountVMBoxesParams) WithDefaults() *GetAccountVMBoxesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get account Vm boxes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAccountVMBoxesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get account Vm boxes params +func (o *GetAccountVMBoxesParams) WithTimeout(timeout time.Duration) *GetAccountVMBoxesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get account Vm boxes params +func (o *GetAccountVMBoxesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get account Vm boxes params +func (o *GetAccountVMBoxesParams) WithContext(ctx context.Context) *GetAccountVMBoxesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get account Vm boxes params +func (o *GetAccountVMBoxesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get account Vm boxes params +func (o *GetAccountVMBoxesParams) WithHTTPClient(client *http.Client) *GetAccountVMBoxesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get account Vm boxes params +func (o *GetAccountVMBoxesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get account Vm boxes params +func (o *GetAccountVMBoxesParams) WithAccountID(accountID string) *GetAccountVMBoxesParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get account Vm boxes params +func (o *GetAccountVMBoxesParams) SetAccountID(accountID string) { + o.AccountID = accountID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAccountVMBoxesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param accountId + if err := r.SetPathParam("accountId", o.AccountID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/kazoo/kazoo_client/user/get_account_vm_boxes_responses.go b/api/kazoo/kazoo_client/user/get_account_vm_boxes_responses.go new file mode 100644 index 0000000..8a74fef --- /dev/null +++ b/api/kazoo/kazoo_client/user/get_account_vm_boxes_responses.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/telnexus/lib/api/kazoo/kazoo_models" +) + +// GetAccountVMBoxesReader is a Reader for the GetAccountVMBoxes structure. +type GetAccountVMBoxesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAccountVMBoxesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAccountVMBoxesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetAccountVMBoxesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetAccountVMBoxesNotFound() + 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()) + } +} + +// NewGetAccountVMBoxesOK creates a GetAccountVMBoxesOK with default headers values +func NewGetAccountVMBoxesOK() *GetAccountVMBoxesOK { + return &GetAccountVMBoxesOK{} +} + +/* GetAccountVMBoxesOK describes a response with status code 200, with default header values. + +Kazoo response +*/ +type GetAccountVMBoxesOK struct { + Payload *kazoo_models.GetAccountVMBoxResponse +} + +func (o *GetAccountVMBoxesOK) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/vmboxes][%d] getAccountVmBoxesOK %+v", 200, o.Payload) +} +func (o *GetAccountVMBoxesOK) GetPayload() *kazoo_models.GetAccountVMBoxResponse { + return o.Payload +} + +func (o *GetAccountVMBoxesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.GetAccountVMBoxResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountVMBoxesUnauthorized creates a GetAccountVMBoxesUnauthorized with default headers values +func NewGetAccountVMBoxesUnauthorized() *GetAccountVMBoxesUnauthorized { + return &GetAccountVMBoxesUnauthorized{} +} + +/* GetAccountVMBoxesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetAccountVMBoxesUnauthorized struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountVMBoxesUnauthorized) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/vmboxes][%d] getAccountVmBoxesUnauthorized %+v", 401, o.Payload) +} +func (o *GetAccountVMBoxesUnauthorized) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountVMBoxesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountVMBoxesNotFound creates a GetAccountVMBoxesNotFound with default headers values +func NewGetAccountVMBoxesNotFound() *GetAccountVMBoxesNotFound { + return &GetAccountVMBoxesNotFound{} +} + +/* GetAccountVMBoxesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetAccountVMBoxesNotFound struct { + Payload *kazoo_models.Error +} + +func (o *GetAccountVMBoxesNotFound) Error() string { + return fmt.Sprintf("[GET /accounts/{accountId}/vmboxes][%d] getAccountVmBoxesNotFound %+v", 404, o.Payload) +} +func (o *GetAccountVMBoxesNotFound) GetPayload() *kazoo_models.Error { + return o.Payload +} + +func (o *GetAccountVMBoxesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(kazoo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/kazoo/kazoo_client/user/user_client.go b/api/kazoo/kazoo_client/user/user_client.go new file mode 100644 index 0000000..e3c8fab --- /dev/null +++ b/api/kazoo/kazoo_client/user/user_client.go @@ -0,0 +1,125 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +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 ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new user API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for user 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 { + GetAccountUsers(params *GetAccountUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountUsersOK, error) + + GetAccountVMBoxes(params *GetAccountVMBoxesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountVMBoxesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetAccountUsers get account users API +*/ +func (a *Client) GetAccountUsers(params *GetAccountUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountUsersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAccountUsersParams() + } + op := &runtime.ClientOperation{ + ID: "getAccountUsers", + Method: "GET", + PathPattern: "/accounts/{accountId}/users", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetAccountUsersReader{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.(*GetAccountUsersOK) + 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 getAccountUsers: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetAccountVMBoxes get account Vm boxes API +*/ +func (a *Client) GetAccountVMBoxes(params *GetAccountVMBoxesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountVMBoxesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAccountVMBoxesParams() + } + op := &runtime.ClientOperation{ + ID: "getAccountVmBoxes", + Method: "GET", + PathPattern: "/accounts/{accountId}/vmboxes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetAccountVMBoxesReader{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.(*GetAccountVMBoxesOK) + 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 getAccountVmBoxes: 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 +} diff --git a/api/kazoo/kazoo_models/error.go b/api/kazoo/kazoo_models/error.go new file mode 100644 index 0000000..304b57a --- /dev/null +++ b/api/kazoo/kazoo_models/error.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package kazoo_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" +) + +// Error error +// +// swagger:model Error +type Error struct { + + // code + Code int32 `json:"code,omitempty"` + + // fields + Fields string `json:"fields,omitempty"` + + // message + Message string `json:"message,omitempty"` +} + +// Validate validates this error +func (m *Error) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this error based on context it is used +func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Error) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Error) UnmarshalBinary(b []byte) error { + var res Error + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/kazoo/kazoo_models/get_account_callflow_response.go b/api/kazoo/kazoo_models/get_account_callflow_response.go new file mode 100644 index 0000000..e83425c --- /dev/null +++ b/api/kazoo/kazoo_models/get_account_callflow_response.go @@ -0,0 +1,296 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package kazoo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GetAccountCallflowResponse get account callflow response +// +// swagger:model GetAccountCallflowResponse +type GetAccountCallflowResponse struct { + + // auth token + // Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImM2M2I1NjY5YmE0NTQzZWVmMTE5OTc3ZTUyNDYxYzRlIn0.eyJpc3MiOiJrYXpvbyIsImlkZW50aXR5X3NpZyI6InJUMW5DNnNOOHNKQWp4blBSSk1LVE5Ed1ZEQWZwek9sSFBnb0FYTHgtQU0iLCJhY2NvdW50X2lkIjoiYTY2ZjJiN2E0MDk0NGI3NDRkY2M2M2NhNmYxMGY0N2EiLCJvd25lcl9pZCI6IjUwOTE2MWZmMmE1NzZiZDZhYmU1YjhjNzVmNmIxNWYwIiwibWV0aG9kIjoiY2JfdXNlcl9hdXRoIiwiZXhwIjoxNTg4ODE0OTcwfQ.cW38X_JKe_bToQ19LzPY1U4aqjf96cFSwkszhqMhdpoR2Kq5JuPxkuCWoG6q49lwpIHb_9mZyoYBG83eLnYkamcORoejyUDb0ob79VKMBAUHAlXPkMNz7H2apLEHp0O8bdxr8ymh0Il9I4nAZSVnPkufQpx8L41Oy_ovU0vHS0jb2dSeXsySO0qcrCsoR9psTtqvB1GZBCEO8S_9EJKpYaT3o-Kio8uHZh7HgCD3NCUbfW8emfE6omTFIzIY7FTwXM_4kaMbWTUv09nN7iIpxJw2r_2drT-V5K8GFXZLAvm_1CqtLOMTYb26i3Iae3-zh9GPANSU3O0fq79kKupHfw + AuthToken string `json:"auth_token,omitempty"` + + // data + Data []*GetAccountCallflowResponseDataItems0 `json:"data"` + + // node + // Example: dqZFtHthbelyE8MI6vU-LA + Node string `json:"node,omitempty"` + + // page size + // Example: 34 + PageSize float64 `json:"page_size,omitempty"` + + // request id + // Example: 3aa5241a8f3150258750425ce3c5c767 + RequestID string `json:"request_id,omitempty"` + + // revision + // Example: c10c73dd4f798fb595267e1d1c4eb9ff + Revision string `json:"revision,omitempty"` + + // status + // Example: success + Status string `json:"status,omitempty"` + + // timestamp + // Example: 2020-05-07T00:53:40Z + Timestamp string `json:"timestamp,omitempty"` + + // version + // Example: 4.3.103 + Version string `json:"version,omitempty"` +} + +// Validate validates this get account callflow response +func (m *GetAccountCallflowResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountCallflowResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get account callflow response based on the context it is used +func (m *GetAccountCallflowResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountCallflowResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountCallflowResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountCallflowResponse) UnmarshalBinary(b []byte) error { + var res GetAccountCallflowResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountCallflowResponseDataItems0 get account callflow response data items0 +// +// swagger:model GetAccountCallflowResponseDataItems0 +type GetAccountCallflowResponseDataItems0 struct { + + // featurecode + Featurecode *GetAccountCallflowResponseDataItems0Featurecode `json:"featurecode,omitempty"` + + // id + // Example: ff059d91a6fe0d16ced1ef6ca1f2bc52 + ID string `json:"id,omitempty"` + + // modules + // Example: ["park"] + Modules []string `json:"modules"` + + // name + // Example: 2004 - Vern iPad + Name string `json:"name,omitempty"` + + // numbers + // Example: ["2004"] + Numbers []string `json:"numbers"` + + // patterns + // Example: ["^\\*3([0-9]*)$"] + Patterns []string `json:"patterns"` +} + +// Validate validates this get account callflow response data items0 +func (m *GetAccountCallflowResponseDataItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFeaturecode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountCallflowResponseDataItems0) validateFeaturecode(formats strfmt.Registry) error { + if swag.IsZero(m.Featurecode) { // not required + return nil + } + + if m.Featurecode != nil { + if err := m.Featurecode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("featurecode") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get account callflow response data items0 based on the context it is used +func (m *GetAccountCallflowResponseDataItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateFeaturecode(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountCallflowResponseDataItems0) contextValidateFeaturecode(ctx context.Context, formats strfmt.Registry) error { + + if m.Featurecode != nil { + if err := m.Featurecode.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("featurecode") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountCallflowResponseDataItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountCallflowResponseDataItems0) UnmarshalBinary(b []byte) error { + var res GetAccountCallflowResponseDataItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountCallflowResponseDataItems0Featurecode get account callflow response data items0 featurecode +// +// swagger:model GetAccountCallflowResponseDataItems0Featurecode +type GetAccountCallflowResponseDataItems0Featurecode struct { + + // name + // Example: park_and_retrieve + Name string `json:"name,omitempty"` + + // number + // Example: 3 + Number string `json:"number,omitempty"` +} + +// Validate validates this get account callflow response data items0 featurecode +func (m *GetAccountCallflowResponseDataItems0Featurecode) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account callflow response data items0 featurecode based on context it is used +func (m *GetAccountCallflowResponseDataItems0Featurecode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountCallflowResponseDataItems0Featurecode) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountCallflowResponseDataItems0Featurecode) UnmarshalBinary(b []byte) error { + var res GetAccountCallflowResponseDataItems0Featurecode + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/kazoo/kazoo_models/get_account_cdr_response.go b/api/kazoo/kazoo_models/get_account_cdr_response.go new file mode 100644 index 0000000..9139816 --- /dev/null +++ b/api/kazoo/kazoo_models/get_account_cdr_response.go @@ -0,0 +1,309 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package kazoo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GetAccountCdrResponse get account cdr response +// +// swagger:model GetAccountCdrResponse +type GetAccountCdrResponse struct { + + // auth token + AuthToken string `json:"auth_token,omitempty"` + + // data + Data []*GetAccountCdrResponseDataItems0 `json:"data"` + + // node + // Example: dqZFtHthbelyE8MI6vU-LA + Node string `json:"node,omitempty"` + + // page size + // Example: 534 + PageSize string `json:"page_size,omitempty"` + + // request id + // Example: e7897c563fb45f3b377046d9b54c3cb5 + RequestID string `json:"request_id,omitempty"` + + // start key + // Example: g2wAAAACbgUAAOqn1w5oAWpq + StartKey string `json:"start_key,omitempty"` + + // status + // Example: success + Status string `json:"status,omitempty"` + + // timestamp + // Example: 2020-05-07T01:06:49Z + Timestamp string `json:"timestamp,omitempty"` + + // version + // Example: 4.3.103 + Version string `json:"version,omitempty"` +} + +// Validate validates this get account cdr response +func (m *GetAccountCdrResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountCdrResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get account cdr response based on the context it is used +func (m *GetAccountCdrResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountCdrResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountCdrResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountCdrResponse) UnmarshalBinary(b []byte) error { + var res GetAccountCdrResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountCdrResponseDataItems0 get account cdr response data items0 +// +// swagger:model GetAccountCdrResponseDataItems0 +type GetAccountCdrResponseDataItems0 struct { + + // authorizing id + // Example: f9627ff1bcca2d112931ee00dcfdb0c6 + AuthorizingID string `json:"authorizing_id,omitempty"` + + // billing seconds + // Example: 0 + BillingSeconds float64 `json:"billing_seconds,omitempty"` + + // bridge id + // Example: 1967142278_134071066@67.231.5.176 + BridgeID string `json:"bridge_id,omitempty"` + + // call id + // Example: 2b35a5ec-43a1-11ea-99b1-ed64c60fd1ac + CallID string `json:"call_id,omitempty"` + + // call priority + CallPriority string `json:"call_priority,omitempty"` + + // call type + CallType string `json:"call_type,omitempty"` + + // callee id name + // Example: Telnexus + CalleeIDName string `json:"callee_id_name,omitempty"` + + // callee id number + // Example: +15108597000 + CalleeIDNumber string `json:"callee_id_number,omitempty"` + + // caller id name + // Example: Unavailable + CallerIDName string `json:"caller_id_name,omitempty"` + + // caller id number + // Example: +17045943795 + CallerIDNumber string `json:"caller_id_number,omitempty"` + + // calling from + // Example: +17045943795 + CallingFrom string `json:"calling_from,omitempty"` + + // cost + // Example: 0 + Cost string `json:"cost,omitempty"` + + // datetime + // Example: 2020-01-30 20:43:28 + Datetime string `json:"datetime,omitempty"` + + // dialed number + // Example: user_jaemid + DialedNumber string `json:"dialed_number,omitempty"` + + // direction + // Example: outbound + Direction string `json:"direction,omitempty"` + + // duration seconds + // Example: 15 + DurationSeconds float64 `json:"duration_seconds,omitempty"` + + // from + // Example: +17045943795@e0f5f0.s.zswitch.net + From string `json:"from,omitempty"` + + // hangup cause + // Example: ORIGINATOR_CANCEL + HangupCause string `json:"hangup_cause,omitempty"` + + // id + // Example: 202001-2b35a5ec-43a1-11ea-99b1-ed64c60fd1ac + ID string `json:"id,omitempty"` + + // interaction id + // Example: 63747636207-cc274afb + InteractionID string `json:"interaction_id,omitempty"` + + // iso 8601 + // Example: 2020-01-30 + Iso8601 string `json:"iso_8601,omitempty"` + + // iso 8601 combined + // Example: 2020-01-30T20:43:28Z + Iso8601Combined string `json:"iso_8601_combined,omitempty"` + + // media server + // Example: fs004.ord.p.zswitch.net + MediaServer string `json:"media_server,omitempty"` + + // other leg call id + // Example: 1967142278_134071066@67.231.5.176 + OtherLegCallID string `json:"other_leg_call_id,omitempty"` + + // owner id + // Example: c0a881b0dfbc7fc574cb67dcaf10879f + OwnerID string `json:"owner_id,omitempty"` + + // rate + // Example: 0.0 + Rate string `json:"rate,omitempty"` + + // rate name + RateName string `json:"rate_name,omitempty"` + + // recording url + RecordingURL string `json:"recording_url,omitempty"` + + // request + // Example: user_jaemid@e0f5f0.s.zswitch.net + Request string `json:"request,omitempty"` + + // rfc 1036 + // Example: Thu, 30 Jan 2020 20:43:28 GMT + Rfc1036 string `json:"rfc_1036,omitempty"` + + // timestamp + // Example: 63747636208 + Timestamp string `json:"timestamp,omitempty"` + + // to + // Example: user_jaemid@e0f5f0.s.zswitch.net + To string `json:"to,omitempty"` + + // unix timestamp + // Example: 1580417008 + UnixTimestamp string `json:"unix_timestamp,omitempty"` +} + +// Validate validates this get account cdr response data items0 +func (m *GetAccountCdrResponseDataItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account cdr response data items0 based on context it is used +func (m *GetAccountCdrResponseDataItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountCdrResponseDataItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountCdrResponseDataItems0) UnmarshalBinary(b []byte) error { + var res GetAccountCdrResponseDataItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/kazoo/kazoo_models/get_account_descendent_response.go b/api/kazoo/kazoo_models/get_account_descendent_response.go new file mode 100644 index 0000000..204228f --- /dev/null +++ b/api/kazoo/kazoo_models/get_account_descendent_response.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package kazoo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GetAccountDescendentResponse get account descendent response +// +// swagger:model GetAccountDescendentResponse +type GetAccountDescendentResponse struct { + + // auth token + // Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImM2M2I1NjY5YmE0NTQzZWVmMTE5OTc3ZTUyNDYxYzRlIn0.eyJpc3MiOiJrYXpvbyIsImlkZW50aXR5X3NpZyI6InJUMW5DNnNOOHNKQWp4blBSSk1LVE5Ed1ZEQWZwek9sSFBnb0FYTHgtQU0iLCJhY2NvdW50X2lkIjoiYTY2ZjJiN2E0MDk0NGI3NDRkY2M2M2NhNmYxMGY0N2EiLCJvd25lcl9pZCI6IjUwOTE2MWZmMmE1NzZiZDZhYmU1YjhjNzVmNmIxNWYwIiwibWV0aG9kIjoiY2JfdXNlcl9hdXRoIiwiZXhwIjoxNTg4ODA3NjcyfQ.rsxUwAef3JnHzTc4eckxIx_RToGbNsKr3WVUoVDEPQ7slKLxhpfDTrNqXQ_kou-1646Z539YQCQGRsB5One4BfEDAfhAmH63d6jKwEU49yQUiZCBn8tbuzN4iiZmYn6z8wmqUQHO2KA3fo6IKrjggs3t1EK8iG05se4ltS21ZVQ-C0HVvvENoERu9iKEcM2SeKhl9Ucl3cqQpWRKBN9BEvTKpuXqM_Bkf2FiczQ3TJQ2SS0YJTYjoIKnOLHfM4H59ZcPwnTh0S3zplJ8e6dQv6t020x0gVYdA_U9EseIGhNQTtMEAztwleZJwdpBh6kiDxJb9-l4ENX4kFtvxsH4QQ + AuthToken string `json:"auth_token,omitempty"` + + // data + Data []*GetAccountDescendentResponseDataItems0 `json:"data"` + + // node + // Example: dqZFtHthbelyE8MI6vU-LA + Node string `json:"node,omitempty"` + + // page size + // Example: 48 + PageSize float64 `json:"page_size,omitempty"` + + // request id + // Example: 0035dec0e0e4c486e3bcd4502cf6a95d + RequestID string `json:"request_id,omitempty"` + + // revision + // Example: b3a4cb72580c7c2f93572a6ef2748b74 + Revision string `json:"revision,omitempty"` + + // start key + // Example: g20AAAAA + StartKey string `json:"start_key,omitempty"` + + // status + // Example: success + Status string `json:"status,omitempty"` + + // timestamp + // Example: 2020-05-06T23:01:48Z + Timestamp string `json:"timestamp,omitempty"` + + // version + // Example: 4.3.103 + Version string `json:"version,omitempty"` +} + +// Validate validates this get account descendent response +func (m *GetAccountDescendentResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountDescendentResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get account descendent response based on the context it is used +func (m *GetAccountDescendentResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountDescendentResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountDescendentResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountDescendentResponse) UnmarshalBinary(b []byte) error { + var res GetAccountDescendentResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountDescendentResponseDataItems0 get account descendent response data items0 +// +// swagger:model GetAccountDescendentResponseDataItems0 +type GetAccountDescendentResponseDataItems0 struct { + + // id + // Example: 7cebd991bd99ffd909dbb08a7d8e2db4 + ID string `json:"id,omitempty"` + + // name + // Example: Affinity + Name string `json:"name,omitempty"` + + // realm + // Example: b5df22.s.zswitch.net + Realm string `json:"realm,omitempty"` + + // tree + // Example: ["fb7cc960d5037466992af0e9504d0b27","d4804caa6d7a78c83ff2bc7fdf646398","33776f3f94eb642c81e199cf5f1059ae","a66f2b7a40944b744dcc63ca6f10f47a"] + Tree []string `json:"tree"` +} + +// Validate validates this get account descendent response data items0 +func (m *GetAccountDescendentResponseDataItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account descendent response data items0 based on context it is used +func (m *GetAccountDescendentResponseDataItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountDescendentResponseDataItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountDescendentResponseDataItems0) UnmarshalBinary(b []byte) error { + var res GetAccountDescendentResponseDataItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/kazoo/kazoo_models/get_account_group_response.go b/api/kazoo/kazoo_models/get_account_group_response.go new file mode 100644 index 0000000..5dcb581 --- /dev/null +++ b/api/kazoo/kazoo_models/get_account_group_response.go @@ -0,0 +1,193 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package kazoo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GetAccountGroupResponse get account group response +// +// swagger:model GetAccountGroupResponse +type GetAccountGroupResponse struct { + + // auth token + AuthToken string `json:"auth_token,omitempty"` + + // data + Data []*GetAccountGroupResponseDataItems0 `json:"data"` + + // node + // Example: dqZFtHthbelyE8MI6vU-LA + Node string `json:"node,omitempty"` + + // page size + // Example: 3 + PageSize float64 `json:"page_size,omitempty"` + + // request id + // Example: 22d1269690b8a553106e929bd8923a55 + RequestID string `json:"request_id,omitempty"` + + // revision + // Example: ac7c6fde786a11c16c4dd265eccb9aa5 + Revision string `json:"revision,omitempty"` + + // status + // Example: success + Status string `json:"status,omitempty"` + + // timestamp + // Example: 2020-05-07T01:36:50Z + Timestamp string `json:"timestamp,omitempty"` + + // version + // Example: 4.3.103 + Version string `json:"version,omitempty"` +} + +// Validate validates this get account group response +func (m *GetAccountGroupResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountGroupResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get account group response based on the context it is used +func (m *GetAccountGroupResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountGroupResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountGroupResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountGroupResponse) UnmarshalBinary(b []byte) error { + var res GetAccountGroupResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountGroupResponseDataItems0 get account group response data items0 +// +// swagger:model GetAccountGroupResponseDataItems0 +type GetAccountGroupResponseDataItems0 struct { + + // endpoints + // Example: 5 + Endpoints float64 `json:"endpoints,omitempty"` + + // id + // Example: e9e0627a0d41c4be4e8fa65a6d4777aa + ID string `json:"id,omitempty"` + + // name + // Example: Berkeley Office + Name string `json:"name,omitempty"` +} + +// Validate validates this get account group response data items0 +func (m *GetAccountGroupResponseDataItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account group response data items0 based on context it is used +func (m *GetAccountGroupResponseDataItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountGroupResponseDataItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountGroupResponseDataItems0) UnmarshalBinary(b []byte) error { + var res GetAccountGroupResponseDataItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/kazoo/kazoo_models/get_account_media_response.go b/api/kazoo/kazoo_models/get_account_media_response.go new file mode 100644 index 0000000..4d7f735 --- /dev/null +++ b/api/kazoo/kazoo_models/get_account_media_response.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package kazoo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GetAccountMediaResponse get account media response +// +// swagger:model GetAccountMediaResponse +type GetAccountMediaResponse struct { + + // auth token + AuthToken string `json:"auth_token,omitempty"` + + // data + Data []*GetAccountMediaResponseDataItems0 `json:"data"` + + // node + // Example: dqZFtHthbelyE8MI6vU-LA + Node string `json:"node,omitempty"` + + // page size + // Example: 49 + PageSize float64 `json:"page_size,omitempty"` + + // request id + // Example: 6e6dc6f474d1aa1689ac27a3c0605b38 + RequestID string `json:"request_id,omitempty"` + + // revision + // Example: b74319c4b8fb8cdba510362fa98facf0 + Revision string `json:"revision,omitempty"` + + // status + // Example: success + Status string `json:"status,omitempty"` + + // timestamp + // Example: 2020-05-07T01:41:49Z + Timestamp string `json:"timestamp,omitempty"` + + // version + // Example: 4.3.103 + Version string `json:"version,omitempty"` +} + +// Validate validates this get account media response +func (m *GetAccountMediaResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountMediaResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get account media response based on the context it is used +func (m *GetAccountMediaResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountMediaResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountMediaResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountMediaResponse) UnmarshalBinary(b []byte) error { + var res GetAccountMediaResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountMediaResponseDataItems0 get account media response data items0 +// +// swagger:model GetAccountMediaResponseDataItems0 +type GetAccountMediaResponseDataItems0 struct { + + // id + // Example: fea26d66047257e74c132092b149e533 + ID string `json:"id,omitempty"` + + // is prompt + // Example: false + IsPrompt bool `json:"is_prompt,omitempty"` + + // language + // Example: en-us + Language string `json:"language,omitempty"` + + // media source + // Example: tts + MediaSource string `json:"media_source,omitempty"` + + // name + // Example: test + Name string `json:"name,omitempty"` +} + +// Validate validates this get account media response data items0 +func (m *GetAccountMediaResponseDataItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account media response data items0 based on context it is used +func (m *GetAccountMediaResponseDataItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountMediaResponseDataItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountMediaResponseDataItems0) UnmarshalBinary(b []byte) error { + var res GetAccountMediaResponseDataItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/kazoo/kazoo_models/get_account_menus_response.go b/api/kazoo/kazoo_models/get_account_menus_response.go new file mode 100644 index 0000000..bf22987 --- /dev/null +++ b/api/kazoo/kazoo_models/get_account_menus_response.go @@ -0,0 +1,189 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package kazoo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GetAccountMenusResponse get account menus response +// +// swagger:model GetAccountMenusResponse +type GetAccountMenusResponse struct { + + // auth token + AuthToken string `json:"auth_token,omitempty"` + + // data + Data []*GetAccountMenusResponseDataItems0 `json:"data"` + + // node + // Example: dqZFtHthbelyE8MI6vU-LA + Node string `json:"node,omitempty"` + + // page size + // Example: 18 + PageSize float64 `json:"page_size,omitempty"` + + // request id + // Example: 36c57100bce810968df34f77465e974a + RequestID string `json:"request_id,omitempty"` + + // revision + // Example: d512f1f2cff2684eec3825938f23275b + Revision string `json:"revision,omitempty"` + + // status + // Example: success + Status string `json:"status,omitempty"` + + // timestamp + // Example: 2020-05-07T01:53:07Z + Timestamp string `json:"timestamp,omitempty"` + + // version + // Example: 4.3.103 + Version string `json:"version,omitempty"` +} + +// Validate validates this get account menus response +func (m *GetAccountMenusResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountMenusResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get account menus response based on the context it is used +func (m *GetAccountMenusResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountMenusResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountMenusResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountMenusResponse) UnmarshalBinary(b []byte) error { + var res GetAccountMenusResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountMenusResponseDataItems0 get account menus response data items0 +// +// swagger:model GetAccountMenusResponseDataItems0 +type GetAccountMenusResponseDataItems0 struct { + + // id + // Example: fe46dd5b556ce876ce693b2d49b6402d + ID string `json:"id,omitempty"` + + // name + // Example: RecordingStudio + Name string `json:"name,omitempty"` +} + +// Validate validates this get account menus response data items0 +func (m *GetAccountMenusResponseDataItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account menus response data items0 based on context it is used +func (m *GetAccountMenusResponseDataItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountMenusResponseDataItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountMenusResponseDataItems0) UnmarshalBinary(b []byte) error { + var res GetAccountMenusResponseDataItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/kazoo/kazoo_models/get_account_response.go b/api/kazoo/kazoo_models/get_account_response.go new file mode 100644 index 0000000..d932a38 --- /dev/null +++ b/api/kazoo/kazoo_models/get_account_response.go @@ -0,0 +1,3070 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package kazoo_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" +) + +// GetAccountResponse get account response +// +// swagger:model GetAccountResponse +type GetAccountResponse struct { + + // auth token + // Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImM2M2I1NjY5YmE0NTQzZWVmMTE5OTc3ZTUyNDYxYzRlIn0.eyJpc3MiOiJrYXpvbyIsImlkZW50aXR5X3NpZyI6InJUMW5DNnNOOHNKQWp4blBSSk1LVE5Ed1ZEQWZwek9sSFBnb0FYTHgtQU0iLCJhY2NvdW50X2lkIjoiYTY2ZjJiN2E0MDk0NGI3NDRkY2M2M2NhNmYxMGY0N2EiLCJvd25lcl9pZCI6IjUwOTE2MWZmMmE1NzZiZDZhYmU1YjhjNzVmNmIxNWYwIiwibWV0aG9kIjoiY2JfdXNlcl9hdXRoIiwiZXhwIjoxNTg4ODA3NjcyfQ.rsxUwAef3JnHzTc4eckxIx_RToGbNsKr3WVUoVDEPQ7slKLxhpfDTrNqXQ_kou-1646Z539YQCQGRsB5One4BfEDAfhAmH63d6jKwEU49yQUiZCBn8tbuzN4iiZmYn6z8wmqUQHO2KA3fo6IKrjggs3t1EK8iG05se4ltS21ZVQ-C0HVvvENoERu9iKEcM2SeKhl9Ucl3cqQpWRKBN9BEvTKpuXqM_Bkf2FiczQ3TJQ2SS0YJTYjoIKnOLHfM4H59ZcPwnTh0S3zplJ8e6dQv6t020x0gVYdA_U9EseIGhNQTtMEAztwleZJwdpBh6kiDxJb9-l4ENX4kFtvxsH4QQ + AuthToken string `json:"auth_token,omitempty"` + + // data + Data *GetAccountResponseData `json:"data,omitempty"` + + // node + // Example: dqZFtHthbelyE8MI6vU-LA + Node string `json:"node,omitempty"` + + // request id + // Example: 1bea6f4e37f65627452f9798d8398385 + RequestID string `json:"request_id,omitempty"` + + // revision + // Example: 270-8664316349384947d416dc00285fb532 + Revision string `json:"revision,omitempty"` + + // status + // Example: success + Status string `json:"status,omitempty"` + + // timestamp + // Example: 2020-05-06T22:42:58Z + Timestamp string `json:"timestamp,omitempty"` + + // version + // Example: 4.3.103 + Version string `json:"version,omitempty"` +} + +// Validate validates this get account response +func (m *GetAccountResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + if m.Data != nil { + if err := m.Data.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get account response based on the context it is used +func (m *GetAccountResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + if m.Data != nil { + if err := m.Data.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponse) UnmarshalBinary(b []byte) error { + var res GetAccountResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseData get account response data +// +// swagger:model GetAccountResponseData +type GetAccountResponseData struct { + + // available apps + // Example: ["voip","cluster","userportal","accounts","developer","pbxs","numbers"] + AvailableApps []string `json:"available_apps"` + + // billing id + // Example: a66f2b7a40944b744dcc63ca6f10f47a + BillingID string `json:"billing_id,omitempty"` + + // billing mode + // Example: manual + BillingMode string `json:"billing_mode,omitempty"` + + // call restriction + CallRestriction *GetAccountResponseDataCallRestriction `json:"call_restriction,omitempty"` + + // caller id + CallerID *GetAccountResponseDataCallerID `json:"caller_id,omitempty"` + + // contact + Contact *GetAccountResponseDataContact `json:"contact,omitempty"` + + // created + // Example: 63552627756 + Created int64 `json:"created,omitempty"` + + // descendants count + // Example: 48 + DescendantsCount float64 `json:"descendants_count,omitempty"` + + // enabled + // Example: true + Enabled bool `json:"enabled,omitempty"` + + // format from uri + // Example: false + FormatFromURI bool `json:"format_from_uri,omitempty"` + + // id + // Example: a66f2b7a40944b744dcc63ca6f10f47a + ID string `json:"id,omitempty"` + + // is reseller + // Example: false + IsReseller bool `json:"is_reseller,omitempty"` + + // language + // Example: en-us + Language string `json:"language,omitempty"` + + // media + Media *GetAccountResponseDataMedia `json:"media,omitempty"` + + // name + // Example: Telnexus Direct + Name string `json:"name,omitempty"` + + // notification preference + // Example: teletype + NotificationPreference string `json:"notification_preference,omitempty"` + + // notifications + Notifications *GetAccountResponseDataNotifications `json:"notifications,omitempty"` + + // provision + Provision *GetAccountResponseDataProvision `json:"provision,omitempty"` + + // realm + // Example: f5b70e.s.zswitch.net + Realm string `json:"realm,omitempty"` + + // reseller id + // Example: 33776f3f94eb642c81e199cf5f1059ae + ResellerID string `json:"reseller_id,omitempty"` + + // superduper admin + // Example: false + SuperduperAdmin bool `json:"superduper_admin,omitempty"` + + // timezone + // Example: America/Los_Angeles + Timezone string `json:"timezone,omitempty"` + + // ui metadata + UIMetadata *GetAccountResponseDataUIMetadata `json:"ui_metadata,omitempty"` + + // ui restrictions + UIRestrictions *GetAccountResponseDataUIRestrictions `json:"ui_restrictions,omitempty"` + + // wnm allow additions + // Example: false + WnmAllowAdditions bool `json:"wnm_allow_additions,omitempty"` +} + +// Validate validates this get account response data +func (m *GetAccountResponseData) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCallRestriction(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCallerID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContact(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMedia(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNotifications(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProvision(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUIMetadata(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUIRestrictions(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountResponseData) validateCallRestriction(formats strfmt.Registry) error { + if swag.IsZero(m.CallRestriction) { // not required + return nil + } + + if m.CallRestriction != nil { + if err := m.CallRestriction.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "call_restriction") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseData) validateCallerID(formats strfmt.Registry) error { + if swag.IsZero(m.CallerID) { // not required + return nil + } + + if m.CallerID != nil { + if err := m.CallerID.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "caller_id") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseData) validateContact(formats strfmt.Registry) error { + if swag.IsZero(m.Contact) { // not required + return nil + } + + if m.Contact != nil { + if err := m.Contact.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "contact") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseData) validateMedia(formats strfmt.Registry) error { + if swag.IsZero(m.Media) { // not required + return nil + } + + if m.Media != nil { + if err := m.Media.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "media") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseData) validateNotifications(formats strfmt.Registry) error { + if swag.IsZero(m.Notifications) { // not required + return nil + } + + if m.Notifications != nil { + if err := m.Notifications.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "notifications") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseData) validateProvision(formats strfmt.Registry) error { + if swag.IsZero(m.Provision) { // not required + return nil + } + + if m.Provision != nil { + if err := m.Provision.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "provision") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseData) validateUIMetadata(formats strfmt.Registry) error { + if swag.IsZero(m.UIMetadata) { // not required + return nil + } + + if m.UIMetadata != nil { + if err := m.UIMetadata.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_metadata") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseData) validateUIRestrictions(formats strfmt.Registry) error { + if swag.IsZero(m.UIRestrictions) { // not required + return nil + } + + if m.UIRestrictions != nil { + if err := m.UIRestrictions.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get account response data based on the context it is used +func (m *GetAccountResponseData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCallRestriction(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCallerID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContact(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMedia(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNotifications(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProvision(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUIMetadata(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUIRestrictions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountResponseData) contextValidateCallRestriction(ctx context.Context, formats strfmt.Registry) error { + + if m.CallRestriction != nil { + if err := m.CallRestriction.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "call_restriction") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseData) contextValidateCallerID(ctx context.Context, formats strfmt.Registry) error { + + if m.CallerID != nil { + if err := m.CallerID.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "caller_id") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseData) contextValidateContact(ctx context.Context, formats strfmt.Registry) error { + + if m.Contact != nil { + if err := m.Contact.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "contact") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseData) contextValidateMedia(ctx context.Context, formats strfmt.Registry) error { + + if m.Media != nil { + if err := m.Media.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "media") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseData) contextValidateNotifications(ctx context.Context, formats strfmt.Registry) error { + + if m.Notifications != nil { + if err := m.Notifications.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "notifications") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseData) contextValidateProvision(ctx context.Context, formats strfmt.Registry) error { + + if m.Provision != nil { + if err := m.Provision.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "provision") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseData) contextValidateUIMetadata(ctx context.Context, formats strfmt.Registry) error { + + if m.UIMetadata != nil { + if err := m.UIMetadata.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_metadata") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseData) contextValidateUIRestrictions(ctx context.Context, formats strfmt.Registry) error { + + if m.UIRestrictions != nil { + if err := m.UIRestrictions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseData) UnmarshalBinary(b []byte) error { + var res GetAccountResponseData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataCallRestriction get account response data call restriction +// +// swagger:model GetAccountResponseDataCallRestriction +type GetAccountResponseDataCallRestriction struct { + + // caribbean + Caribbean *GetAccountResponseDataCallRestrictionCaribbean `json:"caribbean,omitempty"` + + // did us + DidUs *GetAccountResponseDataCallRestrictionDidUs `json:"did_us,omitempty"` + + // directory + Directory *GetAccountResponseDataCallRestrictionDirectory `json:"directory,omitempty"` + + // emergency + Emergency *GetAccountResponseDataCallRestrictionEmergency `json:"emergency,omitempty"` + + // international + International *GetAccountResponseDataCallRestrictionInternational `json:"international,omitempty"` + + // toll us + TollUs *GetAccountResponseDataCallRestrictionTollUs `json:"toll_us,omitempty"` + + // tollfree us + TollfreeUs *GetAccountResponseDataCallRestrictionTollfreeUs `json:"tollfree_us,omitempty"` + + // unknown + Unknown *GetAccountResponseDataCallRestrictionUnknown `json:"unknown,omitempty"` +} + +// Validate validates this get account response data call restriction +func (m *GetAccountResponseDataCallRestriction) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCaribbean(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDidUs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDirectory(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmergency(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInternational(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTollUs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTollfreeUs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUnknown(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountResponseDataCallRestriction) validateCaribbean(formats strfmt.Registry) error { + if swag.IsZero(m.Caribbean) { // not required + return nil + } + + if m.Caribbean != nil { + if err := m.Caribbean.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "call_restriction" + "." + "caribbean") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataCallRestriction) validateDidUs(formats strfmt.Registry) error { + if swag.IsZero(m.DidUs) { // not required + return nil + } + + if m.DidUs != nil { + if err := m.DidUs.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "call_restriction" + "." + "did_us") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataCallRestriction) validateDirectory(formats strfmt.Registry) error { + if swag.IsZero(m.Directory) { // not required + return nil + } + + if m.Directory != nil { + if err := m.Directory.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "call_restriction" + "." + "directory") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataCallRestriction) validateEmergency(formats strfmt.Registry) error { + if swag.IsZero(m.Emergency) { // not required + return nil + } + + if m.Emergency != nil { + if err := m.Emergency.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "call_restriction" + "." + "emergency") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataCallRestriction) validateInternational(formats strfmt.Registry) error { + if swag.IsZero(m.International) { // not required + return nil + } + + if m.International != nil { + if err := m.International.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "call_restriction" + "." + "international") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataCallRestriction) validateTollUs(formats strfmt.Registry) error { + if swag.IsZero(m.TollUs) { // not required + return nil + } + + if m.TollUs != nil { + if err := m.TollUs.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "call_restriction" + "." + "toll_us") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataCallRestriction) validateTollfreeUs(formats strfmt.Registry) error { + if swag.IsZero(m.TollfreeUs) { // not required + return nil + } + + if m.TollfreeUs != nil { + if err := m.TollfreeUs.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "call_restriction" + "." + "tollfree_us") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataCallRestriction) validateUnknown(formats strfmt.Registry) error { + if swag.IsZero(m.Unknown) { // not required + return nil + } + + if m.Unknown != nil { + if err := m.Unknown.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "call_restriction" + "." + "unknown") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get account response data call restriction based on the context it is used +func (m *GetAccountResponseDataCallRestriction) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCaribbean(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDidUs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDirectory(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEmergency(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateInternational(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTollUs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTollfreeUs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUnknown(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountResponseDataCallRestriction) contextValidateCaribbean(ctx context.Context, formats strfmt.Registry) error { + + if m.Caribbean != nil { + if err := m.Caribbean.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "call_restriction" + "." + "caribbean") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataCallRestriction) contextValidateDidUs(ctx context.Context, formats strfmt.Registry) error { + + if m.DidUs != nil { + if err := m.DidUs.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "call_restriction" + "." + "did_us") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataCallRestriction) contextValidateDirectory(ctx context.Context, formats strfmt.Registry) error { + + if m.Directory != nil { + if err := m.Directory.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "call_restriction" + "." + "directory") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataCallRestriction) contextValidateEmergency(ctx context.Context, formats strfmt.Registry) error { + + if m.Emergency != nil { + if err := m.Emergency.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "call_restriction" + "." + "emergency") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataCallRestriction) contextValidateInternational(ctx context.Context, formats strfmt.Registry) error { + + if m.International != nil { + if err := m.International.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "call_restriction" + "." + "international") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataCallRestriction) contextValidateTollUs(ctx context.Context, formats strfmt.Registry) error { + + if m.TollUs != nil { + if err := m.TollUs.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "call_restriction" + "." + "toll_us") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataCallRestriction) contextValidateTollfreeUs(ctx context.Context, formats strfmt.Registry) error { + + if m.TollfreeUs != nil { + if err := m.TollfreeUs.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "call_restriction" + "." + "tollfree_us") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataCallRestriction) contextValidateUnknown(ctx context.Context, formats strfmt.Registry) error { + + if m.Unknown != nil { + if err := m.Unknown.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "call_restriction" + "." + "unknown") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataCallRestriction) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataCallRestriction) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataCallRestriction + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataCallRestrictionCaribbean get account response data call restriction caribbean +// +// swagger:model GetAccountResponseDataCallRestrictionCaribbean +type GetAccountResponseDataCallRestrictionCaribbean struct { + + // action + // Example: inherit + Action string `json:"action,omitempty"` +} + +// Validate validates this get account response data call restriction caribbean +func (m *GetAccountResponseDataCallRestrictionCaribbean) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data call restriction caribbean based on context it is used +func (m *GetAccountResponseDataCallRestrictionCaribbean) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataCallRestrictionCaribbean) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataCallRestrictionCaribbean) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataCallRestrictionCaribbean + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataCallRestrictionDidUs get account response data call restriction did us +// +// swagger:model GetAccountResponseDataCallRestrictionDidUs +type GetAccountResponseDataCallRestrictionDidUs struct { + + // action + // Example: inherit + Action string `json:"action,omitempty"` +} + +// Validate validates this get account response data call restriction did us +func (m *GetAccountResponseDataCallRestrictionDidUs) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data call restriction did us based on context it is used +func (m *GetAccountResponseDataCallRestrictionDidUs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataCallRestrictionDidUs) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataCallRestrictionDidUs) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataCallRestrictionDidUs + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataCallRestrictionDirectory get account response data call restriction directory +// +// swagger:model GetAccountResponseDataCallRestrictionDirectory +type GetAccountResponseDataCallRestrictionDirectory struct { + + // action + // Example: inherit + Action string `json:"action,omitempty"` +} + +// Validate validates this get account response data call restriction directory +func (m *GetAccountResponseDataCallRestrictionDirectory) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data call restriction directory based on context it is used +func (m *GetAccountResponseDataCallRestrictionDirectory) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataCallRestrictionDirectory) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataCallRestrictionDirectory) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataCallRestrictionDirectory + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataCallRestrictionEmergency get account response data call restriction emergency +// +// swagger:model GetAccountResponseDataCallRestrictionEmergency +type GetAccountResponseDataCallRestrictionEmergency struct { + + // action + // Example: inherit + Action string `json:"action,omitempty"` +} + +// Validate validates this get account response data call restriction emergency +func (m *GetAccountResponseDataCallRestrictionEmergency) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data call restriction emergency based on context it is used +func (m *GetAccountResponseDataCallRestrictionEmergency) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataCallRestrictionEmergency) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataCallRestrictionEmergency) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataCallRestrictionEmergency + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataCallRestrictionInternational get account response data call restriction international +// +// swagger:model GetAccountResponseDataCallRestrictionInternational +type GetAccountResponseDataCallRestrictionInternational struct { + + // action + // Example: inherit + Action string `json:"action,omitempty"` +} + +// Validate validates this get account response data call restriction international +func (m *GetAccountResponseDataCallRestrictionInternational) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data call restriction international based on context it is used +func (m *GetAccountResponseDataCallRestrictionInternational) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataCallRestrictionInternational) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataCallRestrictionInternational) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataCallRestrictionInternational + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataCallRestrictionTollUs get account response data call restriction toll us +// +// swagger:model GetAccountResponseDataCallRestrictionTollUs +type GetAccountResponseDataCallRestrictionTollUs struct { + + // action + // Example: inherit + Action string `json:"action,omitempty"` +} + +// Validate validates this get account response data call restriction toll us +func (m *GetAccountResponseDataCallRestrictionTollUs) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data call restriction toll us based on context it is used +func (m *GetAccountResponseDataCallRestrictionTollUs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataCallRestrictionTollUs) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataCallRestrictionTollUs) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataCallRestrictionTollUs + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataCallRestrictionTollfreeUs get account response data call restriction tollfree us +// +// swagger:model GetAccountResponseDataCallRestrictionTollfreeUs +type GetAccountResponseDataCallRestrictionTollfreeUs struct { + + // action + // Example: inherit + Action string `json:"action,omitempty"` +} + +// Validate validates this get account response data call restriction tollfree us +func (m *GetAccountResponseDataCallRestrictionTollfreeUs) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data call restriction tollfree us based on context it is used +func (m *GetAccountResponseDataCallRestrictionTollfreeUs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataCallRestrictionTollfreeUs) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataCallRestrictionTollfreeUs) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataCallRestrictionTollfreeUs + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataCallRestrictionUnknown get account response data call restriction unknown +// +// swagger:model GetAccountResponseDataCallRestrictionUnknown +type GetAccountResponseDataCallRestrictionUnknown struct { + + // action + // Example: inherit + Action string `json:"action,omitempty"` +} + +// Validate validates this get account response data call restriction unknown +func (m *GetAccountResponseDataCallRestrictionUnknown) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data call restriction unknown based on context it is used +func (m *GetAccountResponseDataCallRestrictionUnknown) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataCallRestrictionUnknown) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataCallRestrictionUnknown) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataCallRestrictionUnknown + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataCallerID get account response data caller ID +// +// swagger:model GetAccountResponseDataCallerID +type GetAccountResponseDataCallerID struct { + + // emergency + Emergency *GetAccountResponseDataCallerIDEmergency `json:"emergency,omitempty"` + + // external + External *GetAccountResponseDataCallerIDExternal `json:"external,omitempty"` +} + +// Validate validates this get account response data caller ID +func (m *GetAccountResponseDataCallerID) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEmergency(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExternal(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountResponseDataCallerID) validateEmergency(formats strfmt.Registry) error { + if swag.IsZero(m.Emergency) { // not required + return nil + } + + if m.Emergency != nil { + if err := m.Emergency.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "caller_id" + "." + "emergency") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataCallerID) validateExternal(formats strfmt.Registry) error { + if swag.IsZero(m.External) { // not required + return nil + } + + if m.External != nil { + if err := m.External.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "caller_id" + "." + "external") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get account response data caller ID based on the context it is used +func (m *GetAccountResponseDataCallerID) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEmergency(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExternal(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountResponseDataCallerID) contextValidateEmergency(ctx context.Context, formats strfmt.Registry) error { + + if m.Emergency != nil { + if err := m.Emergency.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "caller_id" + "." + "emergency") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataCallerID) contextValidateExternal(ctx context.Context, formats strfmt.Registry) error { + + if m.External != nil { + if err := m.External.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "caller_id" + "." + "external") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataCallerID) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataCallerID) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataCallerID + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataCallerIDEmergency get account response data caller ID emergency +// +// swagger:model GetAccountResponseDataCallerIDEmergency +type GetAccountResponseDataCallerIDEmergency struct { + + // name + // Example: Telnexus + Name string `json:"name,omitempty"` + + // number + // Example: +15109911114 + Number string `json:"number,omitempty"` +} + +// Validate validates this get account response data caller ID emergency +func (m *GetAccountResponseDataCallerIDEmergency) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data caller ID emergency based on context it is used +func (m *GetAccountResponseDataCallerIDEmergency) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataCallerIDEmergency) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataCallerIDEmergency) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataCallerIDEmergency + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataCallerIDExternal get account response data caller ID external +// +// swagger:model GetAccountResponseDataCallerIDExternal +type GetAccountResponseDataCallerIDExternal struct { + + // name + // Example: Telnexus + Name string `json:"name,omitempty"` + + // number + // Example: +15109911114 + Number string `json:"number,omitempty"` +} + +// Validate validates this get account response data caller ID external +func (m *GetAccountResponseDataCallerIDExternal) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data caller ID external based on context it is used +func (m *GetAccountResponseDataCallerIDExternal) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataCallerIDExternal) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataCallerIDExternal) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataCallerIDExternal + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataContact get account response data contact +// +// swagger:model GetAccountResponseDataContact +type GetAccountResponseDataContact struct { + + // billing + Billing *GetAccountResponseDataContactBilling `json:"billing,omitempty"` + + // technical + Technical *GetAccountResponseDataContactTechnical `json:"technical,omitempty"` +} + +// Validate validates this get account response data contact +func (m *GetAccountResponseDataContact) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBilling(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTechnical(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountResponseDataContact) validateBilling(formats strfmt.Registry) error { + if swag.IsZero(m.Billing) { // not required + return nil + } + + if m.Billing != nil { + if err := m.Billing.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "contact" + "." + "billing") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataContact) validateTechnical(formats strfmt.Registry) error { + if swag.IsZero(m.Technical) { // not required + return nil + } + + if m.Technical != nil { + if err := m.Technical.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "contact" + "." + "technical") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get account response data contact based on the context it is used +func (m *GetAccountResponseDataContact) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBilling(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTechnical(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountResponseDataContact) contextValidateBilling(ctx context.Context, formats strfmt.Registry) error { + + if m.Billing != nil { + if err := m.Billing.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "contact" + "." + "billing") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataContact) contextValidateTechnical(ctx context.Context, formats strfmt.Registry) error { + + if m.Technical != nil { + if err := m.Technical.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "contact" + "." + "technical") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataContact) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataContact) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataContact + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataContactBilling get account response data contact billing +// +// swagger:model GetAccountResponseDataContactBilling +type GetAccountResponseDataContactBilling struct { + + // email + // Example: noc@telnexus.com + Email string `json:"email,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // number + // Example: 5108597000 + Number string `json:"number,omitempty"` +} + +// Validate validates this get account response data contact billing +func (m *GetAccountResponseDataContactBilling) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data contact billing based on context it is used +func (m *GetAccountResponseDataContactBilling) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataContactBilling) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataContactBilling) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataContactBilling + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataContactTechnical get account response data contact technical +// +// swagger:model GetAccountResponseDataContactTechnical +type GetAccountResponseDataContactTechnical struct { + + // email + // Example: noc@telnexus.com + Email string `json:"email,omitempty"` + + // number + // Example: 5108497000 + Number string `json:"number,omitempty"` +} + +// Validate validates this get account response data contact technical +func (m *GetAccountResponseDataContactTechnical) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data contact technical based on context it is used +func (m *GetAccountResponseDataContactTechnical) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataContactTechnical) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataContactTechnical) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataContactTechnical + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataMedia get account response data media +// +// swagger:model GetAccountResponseDataMedia +type GetAccountResponseDataMedia struct { + + // bypass media + // Example: auto + BypassMedia string `json:"bypass_media,omitempty"` +} + +// Validate validates this get account response data media +func (m *GetAccountResponseDataMedia) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data media based on context it is used +func (m *GetAccountResponseDataMedia) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataMedia) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataMedia) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataMedia + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataNotifications get account response data notifications +// +// swagger:model GetAccountResponseDataNotifications +type GetAccountResponseDataNotifications struct { + + // fax to email + FaxToEmail *GetAccountResponseDataNotificationsFaxToEmail `json:"fax_to_email,omitempty"` + + // low balance + LowBalance *GetAccountResponseDataNotificationsLowBalance `json:"low_balance,omitempty"` + + // voicemail to email + VoicemailToEmail *GetAccountResponseDataNotificationsVoicemailToEmail `json:"voicemail_to_email,omitempty"` +} + +// Validate validates this get account response data notifications +func (m *GetAccountResponseDataNotifications) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFaxToEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLowBalance(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVoicemailToEmail(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountResponseDataNotifications) validateFaxToEmail(formats strfmt.Registry) error { + if swag.IsZero(m.FaxToEmail) { // not required + return nil + } + + if m.FaxToEmail != nil { + if err := m.FaxToEmail.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "notifications" + "." + "fax_to_email") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataNotifications) validateLowBalance(formats strfmt.Registry) error { + if swag.IsZero(m.LowBalance) { // not required + return nil + } + + if m.LowBalance != nil { + if err := m.LowBalance.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "notifications" + "." + "low_balance") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataNotifications) validateVoicemailToEmail(formats strfmt.Registry) error { + if swag.IsZero(m.VoicemailToEmail) { // not required + return nil + } + + if m.VoicemailToEmail != nil { + if err := m.VoicemailToEmail.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "notifications" + "." + "voicemail_to_email") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get account response data notifications based on the context it is used +func (m *GetAccountResponseDataNotifications) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateFaxToEmail(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLowBalance(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVoicemailToEmail(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountResponseDataNotifications) contextValidateFaxToEmail(ctx context.Context, formats strfmt.Registry) error { + + if m.FaxToEmail != nil { + if err := m.FaxToEmail.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "notifications" + "." + "fax_to_email") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataNotifications) contextValidateLowBalance(ctx context.Context, formats strfmt.Registry) error { + + if m.LowBalance != nil { + if err := m.LowBalance.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "notifications" + "." + "low_balance") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataNotifications) contextValidateVoicemailToEmail(ctx context.Context, formats strfmt.Registry) error { + + if m.VoicemailToEmail != nil { + if err := m.VoicemailToEmail.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "notifications" + "." + "voicemail_to_email") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataNotifications) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataNotifications) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataNotifications + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataNotificationsFaxToEmail get account response data notifications fax to email +// +// swagger:model GetAccountResponseDataNotificationsFaxToEmail +type GetAccountResponseDataNotificationsFaxToEmail struct { + + // service name + // Example: support@telnexus.com + ServiceName string `json:"service_name,omitempty"` + + // service provider + // Example: support@telnexus.com + ServiceProvider string `json:"service_provider,omitempty"` + + // service url + // Example: telnexus.com + ServiceURL string `json:"service_url,omitempty"` + + // support email + // Example: support@telnexus.com + SupportEmail string `json:"support_email,omitempty"` + + // support number + // Example: 510-991-1114 + SupportNumber string `json:"support_number,omitempty"` +} + +// Validate validates this get account response data notifications fax to email +func (m *GetAccountResponseDataNotificationsFaxToEmail) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data notifications fax to email based on context it is used +func (m *GetAccountResponseDataNotificationsFaxToEmail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataNotificationsFaxToEmail) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataNotificationsFaxToEmail) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataNotificationsFaxToEmail + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataNotificationsLowBalance get account response data notifications low balance +// +// swagger:model GetAccountResponseDataNotificationsLowBalance +type GetAccountResponseDataNotificationsLowBalance struct { + + // sent low balance + // Example: false + SentLowBalance bool `json:"sent_low_balance,omitempty"` +} + +// Validate validates this get account response data notifications low balance +func (m *GetAccountResponseDataNotificationsLowBalance) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data notifications low balance based on context it is used +func (m *GetAccountResponseDataNotificationsLowBalance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataNotificationsLowBalance) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataNotificationsLowBalance) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataNotificationsLowBalance + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataNotificationsVoicemailToEmail get account response data notifications voicemail to email +// +// swagger:model GetAccountResponseDataNotificationsVoicemailToEmail +type GetAccountResponseDataNotificationsVoicemailToEmail struct { + + // service name + // Example: support@telnexus.com + ServiceName string `json:"service_name,omitempty"` + + // service provider + // Example: support@telnexus.com + ServiceProvider string `json:"service_provider,omitempty"` + + // service url + // Example: telnexus.com + ServiceURL string `json:"service_url,omitempty"` + + // support email + // Example: support@telnexus.com + SupportEmail string `json:"support_email,omitempty"` + + // support number + // Example: 510-991-1114 + SupportNumber string `json:"support_number,omitempty"` +} + +// Validate validates this get account response data notifications voicemail to email +func (m *GetAccountResponseDataNotificationsVoicemailToEmail) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data notifications voicemail to email based on context it is used +func (m *GetAccountResponseDataNotificationsVoicemailToEmail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataNotificationsVoicemailToEmail) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataNotificationsVoicemailToEmail) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataNotificationsVoicemailToEmail + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataProvision get account response data provision +// +// swagger:model GetAccountResponseDataProvision +type GetAccountResponseDataProvision struct { + + // admin password + AdminPassword string `json:"admin_password,omitempty"` +} + +// Validate validates this get account response data provision +func (m *GetAccountResponseDataProvision) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data provision based on context it is used +func (m *GetAccountResponseDataProvision) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataProvision) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataProvision) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataProvision + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataUIMetadata get account response data UI metadata +// +// swagger:model GetAccountResponseDataUIMetadata +type GetAccountResponseDataUIMetadata struct { + + // origin + // Example: accounts + Origin string `json:"origin,omitempty"` + + // ui + // Example: monster-ui + UI string `json:"ui,omitempty"` + + // version + // Example: 4.1-56 + Version string `json:"version,omitempty"` +} + +// Validate validates this get account response data UI metadata +func (m *GetAccountResponseDataUIMetadata) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data UI metadata based on context it is used +func (m *GetAccountResponseDataUIMetadata) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataUIMetadata) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataUIMetadata) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataUIMetadata + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataUIRestrictions get account response data UI restrictions +// +// swagger:model GetAccountResponseDataUIRestrictions +type GetAccountResponseDataUIRestrictions struct { + + // myaccount + Myaccount *GetAccountResponseDataUIRestrictionsMyaccount `json:"myaccount,omitempty"` +} + +// Validate validates this get account response data UI restrictions +func (m *GetAccountResponseDataUIRestrictions) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMyaccount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountResponseDataUIRestrictions) validateMyaccount(formats strfmt.Registry) error { + if swag.IsZero(m.Myaccount) { // not required + return nil + } + + if m.Myaccount != nil { + if err := m.Myaccount.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions" + "." + "myaccount") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get account response data UI restrictions based on the context it is used +func (m *GetAccountResponseDataUIRestrictions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMyaccount(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountResponseDataUIRestrictions) contextValidateMyaccount(ctx context.Context, formats strfmt.Registry) error { + + if m.Myaccount != nil { + if err := m.Myaccount.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions" + "." + "myaccount") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictions) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictions) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataUIRestrictions + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataUIRestrictionsMyaccount get account response data UI restrictions myaccount +// +// swagger:model GetAccountResponseDataUIRestrictionsMyaccount +type GetAccountResponseDataUIRestrictionsMyaccount struct { + + // account + Account *GetAccountResponseDataUIRestrictionsMyaccountAccount `json:"account,omitempty"` + + // balance + Balance *GetAccountResponseDataUIRestrictionsMyaccountBalance `json:"balance,omitempty"` + + // billing + Billing *GetAccountResponseDataUIRestrictionsMyaccountBilling `json:"billing,omitempty"` + + // error tracker + ErrorTracker *GetAccountResponseDataUIRestrictionsMyaccountErrorTracker `json:"errorTracker,omitempty"` + + // inbound + Inbound *GetAccountResponseDataUIRestrictionsMyaccountInbound `json:"inbound,omitempty"` + + // outbound + Outbound *GetAccountResponseDataUIRestrictionsMyaccountOutbound `json:"outbound,omitempty"` + + // service plan + ServicePlan *GetAccountResponseDataUIRestrictionsMyaccountServicePlan `json:"service_plan,omitempty"` + + // transactions + Transactions *GetAccountResponseDataUIRestrictionsMyaccountTransactions `json:"transactions,omitempty"` + + // twoway + Twoway *GetAccountResponseDataUIRestrictionsMyaccountTwoway `json:"twoway,omitempty"` + + // user + User *GetAccountResponseDataUIRestrictionsMyaccountUser `json:"user,omitempty"` +} + +// Validate validates this get account response data UI restrictions myaccount +func (m *GetAccountResponseDataUIRestrictionsMyaccount) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAccount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBalance(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBilling(formats); err != nil { + res = append(res, err) + } + + if err := m.validateErrorTracker(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInbound(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOutbound(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServicePlan(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransactions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTwoway(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUser(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountResponseDataUIRestrictionsMyaccount) validateAccount(formats strfmt.Registry) error { + if swag.IsZero(m.Account) { // not required + return nil + } + + if m.Account != nil { + if err := m.Account.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions" + "." + "myaccount" + "." + "account") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataUIRestrictionsMyaccount) validateBalance(formats strfmt.Registry) error { + if swag.IsZero(m.Balance) { // not required + return nil + } + + if m.Balance != nil { + if err := m.Balance.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions" + "." + "myaccount" + "." + "balance") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataUIRestrictionsMyaccount) validateBilling(formats strfmt.Registry) error { + if swag.IsZero(m.Billing) { // not required + return nil + } + + if m.Billing != nil { + if err := m.Billing.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions" + "." + "myaccount" + "." + "billing") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataUIRestrictionsMyaccount) validateErrorTracker(formats strfmt.Registry) error { + if swag.IsZero(m.ErrorTracker) { // not required + return nil + } + + if m.ErrorTracker != nil { + if err := m.ErrorTracker.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions" + "." + "myaccount" + "." + "errorTracker") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataUIRestrictionsMyaccount) validateInbound(formats strfmt.Registry) error { + if swag.IsZero(m.Inbound) { // not required + return nil + } + + if m.Inbound != nil { + if err := m.Inbound.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions" + "." + "myaccount" + "." + "inbound") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataUIRestrictionsMyaccount) validateOutbound(formats strfmt.Registry) error { + if swag.IsZero(m.Outbound) { // not required + return nil + } + + if m.Outbound != nil { + if err := m.Outbound.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions" + "." + "myaccount" + "." + "outbound") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataUIRestrictionsMyaccount) validateServicePlan(formats strfmt.Registry) error { + if swag.IsZero(m.ServicePlan) { // not required + return nil + } + + if m.ServicePlan != nil { + if err := m.ServicePlan.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions" + "." + "myaccount" + "." + "service_plan") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataUIRestrictionsMyaccount) validateTransactions(formats strfmt.Registry) error { + if swag.IsZero(m.Transactions) { // not required + return nil + } + + if m.Transactions != nil { + if err := m.Transactions.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions" + "." + "myaccount" + "." + "transactions") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataUIRestrictionsMyaccount) validateTwoway(formats strfmt.Registry) error { + if swag.IsZero(m.Twoway) { // not required + return nil + } + + if m.Twoway != nil { + if err := m.Twoway.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions" + "." + "myaccount" + "." + "twoway") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataUIRestrictionsMyaccount) validateUser(formats strfmt.Registry) error { + if swag.IsZero(m.User) { // not required + return nil + } + + if m.User != nil { + if err := m.User.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions" + "." + "myaccount" + "." + "user") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get account response data UI restrictions myaccount based on the context it is used +func (m *GetAccountResponseDataUIRestrictionsMyaccount) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAccount(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBalance(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBilling(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateErrorTracker(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateInbound(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOutbound(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServicePlan(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTransactions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTwoway(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUser(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountResponseDataUIRestrictionsMyaccount) contextValidateAccount(ctx context.Context, formats strfmt.Registry) error { + + if m.Account != nil { + if err := m.Account.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions" + "." + "myaccount" + "." + "account") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataUIRestrictionsMyaccount) contextValidateBalance(ctx context.Context, formats strfmt.Registry) error { + + if m.Balance != nil { + if err := m.Balance.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions" + "." + "myaccount" + "." + "balance") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataUIRestrictionsMyaccount) contextValidateBilling(ctx context.Context, formats strfmt.Registry) error { + + if m.Billing != nil { + if err := m.Billing.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions" + "." + "myaccount" + "." + "billing") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataUIRestrictionsMyaccount) contextValidateErrorTracker(ctx context.Context, formats strfmt.Registry) error { + + if m.ErrorTracker != nil { + if err := m.ErrorTracker.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions" + "." + "myaccount" + "." + "errorTracker") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataUIRestrictionsMyaccount) contextValidateInbound(ctx context.Context, formats strfmt.Registry) error { + + if m.Inbound != nil { + if err := m.Inbound.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions" + "." + "myaccount" + "." + "inbound") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataUIRestrictionsMyaccount) contextValidateOutbound(ctx context.Context, formats strfmt.Registry) error { + + if m.Outbound != nil { + if err := m.Outbound.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions" + "." + "myaccount" + "." + "outbound") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataUIRestrictionsMyaccount) contextValidateServicePlan(ctx context.Context, formats strfmt.Registry) error { + + if m.ServicePlan != nil { + if err := m.ServicePlan.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions" + "." + "myaccount" + "." + "service_plan") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataUIRestrictionsMyaccount) contextValidateTransactions(ctx context.Context, formats strfmt.Registry) error { + + if m.Transactions != nil { + if err := m.Transactions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions" + "." + "myaccount" + "." + "transactions") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataUIRestrictionsMyaccount) contextValidateTwoway(ctx context.Context, formats strfmt.Registry) error { + + if m.Twoway != nil { + if err := m.Twoway.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions" + "." + "myaccount" + "." + "twoway") + } + return err + } + } + + return nil +} + +func (m *GetAccountResponseDataUIRestrictionsMyaccount) contextValidateUser(ctx context.Context, formats strfmt.Registry) error { + + if m.User != nil { + if err := m.User.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "ui_restrictions" + "." + "myaccount" + "." + "user") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictionsMyaccount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictionsMyaccount) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataUIRestrictionsMyaccount + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataUIRestrictionsMyaccountAccount get account response data UI restrictions myaccount account +// +// swagger:model GetAccountResponseDataUIRestrictionsMyaccountAccount +type GetAccountResponseDataUIRestrictionsMyaccountAccount struct { + + // show tab + // Example: true + ShowTab bool `json:"show_tab,omitempty"` +} + +// Validate validates this get account response data UI restrictions myaccount account +func (m *GetAccountResponseDataUIRestrictionsMyaccountAccount) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data UI restrictions myaccount account based on context it is used +func (m *GetAccountResponseDataUIRestrictionsMyaccountAccount) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictionsMyaccountAccount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictionsMyaccountAccount) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataUIRestrictionsMyaccountAccount + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataUIRestrictionsMyaccountBalance get account response data UI restrictions myaccount balance +// +// swagger:model GetAccountResponseDataUIRestrictionsMyaccountBalance +type GetAccountResponseDataUIRestrictionsMyaccountBalance struct { + + // show credit + // Example: true + ShowCredit bool `json:"show_credit,omitempty"` + + // show header + // Example: true + ShowHeader bool `json:"show_header,omitempty"` + + // show minutes + // Example: true + ShowMinutes bool `json:"show_minutes,omitempty"` + + // show tab + // Example: true + ShowTab bool `json:"show_tab,omitempty"` +} + +// Validate validates this get account response data UI restrictions myaccount balance +func (m *GetAccountResponseDataUIRestrictionsMyaccountBalance) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data UI restrictions myaccount balance based on context it is used +func (m *GetAccountResponseDataUIRestrictionsMyaccountBalance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictionsMyaccountBalance) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictionsMyaccountBalance) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataUIRestrictionsMyaccountBalance + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataUIRestrictionsMyaccountBilling get account response data UI restrictions myaccount billing +// +// swagger:model GetAccountResponseDataUIRestrictionsMyaccountBilling +type GetAccountResponseDataUIRestrictionsMyaccountBilling struct { + + // show tab + // Example: true + ShowTab bool `json:"show_tab,omitempty"` +} + +// Validate validates this get account response data UI restrictions myaccount billing +func (m *GetAccountResponseDataUIRestrictionsMyaccountBilling) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data UI restrictions myaccount billing based on context it is used +func (m *GetAccountResponseDataUIRestrictionsMyaccountBilling) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictionsMyaccountBilling) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictionsMyaccountBilling) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataUIRestrictionsMyaccountBilling + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataUIRestrictionsMyaccountErrorTracker get account response data UI restrictions myaccount error tracker +// +// swagger:model GetAccountResponseDataUIRestrictionsMyaccountErrorTracker +type GetAccountResponseDataUIRestrictionsMyaccountErrorTracker struct { + + // show tab + // Example: true + ShowTab bool `json:"show_tab,omitempty"` +} + +// Validate validates this get account response data UI restrictions myaccount error tracker +func (m *GetAccountResponseDataUIRestrictionsMyaccountErrorTracker) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data UI restrictions myaccount error tracker based on context it is used +func (m *GetAccountResponseDataUIRestrictionsMyaccountErrorTracker) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictionsMyaccountErrorTracker) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictionsMyaccountErrorTracker) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataUIRestrictionsMyaccountErrorTracker + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataUIRestrictionsMyaccountInbound get account response data UI restrictions myaccount inbound +// +// swagger:model GetAccountResponseDataUIRestrictionsMyaccountInbound +type GetAccountResponseDataUIRestrictionsMyaccountInbound struct { + + // show tab + // Example: true + ShowTab bool `json:"show_tab,omitempty"` +} + +// Validate validates this get account response data UI restrictions myaccount inbound +func (m *GetAccountResponseDataUIRestrictionsMyaccountInbound) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data UI restrictions myaccount inbound based on context it is used +func (m *GetAccountResponseDataUIRestrictionsMyaccountInbound) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictionsMyaccountInbound) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictionsMyaccountInbound) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataUIRestrictionsMyaccountInbound + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataUIRestrictionsMyaccountOutbound get account response data UI restrictions myaccount outbound +// +// swagger:model GetAccountResponseDataUIRestrictionsMyaccountOutbound +type GetAccountResponseDataUIRestrictionsMyaccountOutbound struct { + + // show tab + // Example: true + ShowTab bool `json:"show_tab,omitempty"` +} + +// Validate validates this get account response data UI restrictions myaccount outbound +func (m *GetAccountResponseDataUIRestrictionsMyaccountOutbound) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data UI restrictions myaccount outbound based on context it is used +func (m *GetAccountResponseDataUIRestrictionsMyaccountOutbound) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictionsMyaccountOutbound) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictionsMyaccountOutbound) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataUIRestrictionsMyaccountOutbound + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataUIRestrictionsMyaccountServicePlan get account response data UI restrictions myaccount service plan +// +// swagger:model GetAccountResponseDataUIRestrictionsMyaccountServicePlan +type GetAccountResponseDataUIRestrictionsMyaccountServicePlan struct { + + // show tab + // Example: true + ShowTab bool `json:"show_tab,omitempty"` +} + +// Validate validates this get account response data UI restrictions myaccount service plan +func (m *GetAccountResponseDataUIRestrictionsMyaccountServicePlan) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data UI restrictions myaccount service plan based on context it is used +func (m *GetAccountResponseDataUIRestrictionsMyaccountServicePlan) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictionsMyaccountServicePlan) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictionsMyaccountServicePlan) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataUIRestrictionsMyaccountServicePlan + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataUIRestrictionsMyaccountTransactions get account response data UI restrictions myaccount transactions +// +// swagger:model GetAccountResponseDataUIRestrictionsMyaccountTransactions +type GetAccountResponseDataUIRestrictionsMyaccountTransactions struct { + + // show tab + // Example: true + ShowTab bool `json:"show_tab,omitempty"` +} + +// Validate validates this get account response data UI restrictions myaccount transactions +func (m *GetAccountResponseDataUIRestrictionsMyaccountTransactions) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data UI restrictions myaccount transactions based on context it is used +func (m *GetAccountResponseDataUIRestrictionsMyaccountTransactions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictionsMyaccountTransactions) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictionsMyaccountTransactions) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataUIRestrictionsMyaccountTransactions + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataUIRestrictionsMyaccountTwoway get account response data UI restrictions myaccount twoway +// +// swagger:model GetAccountResponseDataUIRestrictionsMyaccountTwoway +type GetAccountResponseDataUIRestrictionsMyaccountTwoway struct { + + // show tab + // Example: true + ShowTab bool `json:"show_tab,omitempty"` +} + +// Validate validates this get account response data UI restrictions myaccount twoway +func (m *GetAccountResponseDataUIRestrictionsMyaccountTwoway) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data UI restrictions myaccount twoway based on context it is used +func (m *GetAccountResponseDataUIRestrictionsMyaccountTwoway) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictionsMyaccountTwoway) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictionsMyaccountTwoway) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataUIRestrictionsMyaccountTwoway + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountResponseDataUIRestrictionsMyaccountUser get account response data UI restrictions myaccount user +// +// swagger:model GetAccountResponseDataUIRestrictionsMyaccountUser +type GetAccountResponseDataUIRestrictionsMyaccountUser struct { + + // show tab + // Example: true + ShowTab bool `json:"show_tab,omitempty"` +} + +// Validate validates this get account response data UI restrictions myaccount user +func (m *GetAccountResponseDataUIRestrictionsMyaccountUser) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account response data UI restrictions myaccount user based on context it is used +func (m *GetAccountResponseDataUIRestrictionsMyaccountUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictionsMyaccountUser) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountResponseDataUIRestrictionsMyaccountUser) UnmarshalBinary(b []byte) error { + var res GetAccountResponseDataUIRestrictionsMyaccountUser + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/kazoo/kazoo_models/get_account_time_rule_response.go b/api/kazoo/kazoo_models/get_account_time_rule_response.go new file mode 100644 index 0000000..db4109c --- /dev/null +++ b/api/kazoo/kazoo_models/get_account_time_rule_response.go @@ -0,0 +1,189 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package kazoo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GetAccountTimeRuleResponse get account time rule response +// +// swagger:model GetAccountTimeRuleResponse +type GetAccountTimeRuleResponse struct { + + // auth token + AuthToken string `json:"auth_token,omitempty"` + + // data + Data []*GetAccountTimeRuleResponseDataItems0 `json:"data"` + + // node + // Example: dqZFtHthbelyE8MI6vU-LA + Node string `json:"node,omitempty"` + + // page size + // Example: 1 + PageSize float64 `json:"page_size,omitempty"` + + // request id + // Example: 7372ec1ec4dc316cd0a8cf6786defde6 + RequestID string `json:"request_id,omitempty"` + + // revision + // Example: b694bae5e001d52cf40637b618bc6bfb + Revision string `json:"revision,omitempty"` + + // status + // Example: success + Status string `json:"status,omitempty"` + + // timestamp + // Example: 2020-05-07T02:43:06Z + Timestamp string `json:"timestamp,omitempty"` + + // version + // Example: 4.3.103 + Version string `json:"version,omitempty"` +} + +// Validate validates this get account time rule response +func (m *GetAccountTimeRuleResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountTimeRuleResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get account time rule response based on the context it is used +func (m *GetAccountTimeRuleResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountTimeRuleResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountTimeRuleResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountTimeRuleResponse) UnmarshalBinary(b []byte) error { + var res GetAccountTimeRuleResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountTimeRuleResponseDataItems0 get account time rule response data items0 +// +// swagger:model GetAccountTimeRuleResponseDataItems0 +type GetAccountTimeRuleResponseDataItems0 struct { + + // id + // Example: 1c3939fd0afcdadaa2986bc61c787d03 + ID string `json:"id,omitempty"` + + // name + // Example: Business Hours + Name string `json:"name,omitempty"` +} + +// Validate validates this get account time rule response data items0 +func (m *GetAccountTimeRuleResponseDataItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account time rule response data items0 based on context it is used +func (m *GetAccountTimeRuleResponseDataItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountTimeRuleResponseDataItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountTimeRuleResponseDataItems0) UnmarshalBinary(b []byte) error { + var res GetAccountTimeRuleResponseDataItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/kazoo/kazoo_models/get_account_user_response.go b/api/kazoo/kazoo_models/get_account_user_response.go new file mode 100644 index 0000000..5db2ac0 --- /dev/null +++ b/api/kazoo/kazoo_models/get_account_user_response.go @@ -0,0 +1,213 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package kazoo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GetAccountUserResponse get account user response +// +// swagger:model GetAccountUserResponse +type GetAccountUserResponse struct { + + // auth token + AuthToken string `json:"auth_token,omitempty"` + + // data + Data []*GetAccountUserResponseDataItems0 `json:"data"` + + // node + // Example: dqZFtHthbelyE8MI6vU-LA + Node string `json:"node,omitempty"` + + // page size + // Example: 4 + PageSize float64 `json:"page_size,omitempty"` + + // request id + // Example: c11b939a99b181b3a09b7770c4e49302 + RequestID string `json:"request_id,omitempty"` + + // revision + // Example: c989520cf895f314b32d163d3b59d723 + Revision string `json:"revision,omitempty"` + + // status + // Example: success + Status string `json:"status,omitempty"` + + // timestamp + // Example: 2020-05-07T02:44:28Z + Timestamp string `json:"timestamp,omitempty"` + + // version + // Example: 4.3.103 + Version string `json:"version,omitempty"` +} + +// Validate validates this get account user response +func (m *GetAccountUserResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountUserResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get account user response based on the context it is used +func (m *GetAccountUserResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountUserResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountUserResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountUserResponse) UnmarshalBinary(b []byte) error { + var res GetAccountUserResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountUserResponseDataItems0 get account user response data items0 +// +// swagger:model GetAccountUserResponseDataItems0 +type GetAccountUserResponseDataItems0 struct { + + // email + // Example: reception@telnexus.com + Email string `json:"email,omitempty"` + + // features + // Example: ["vm_to_email"] + Features []string `json:"features"` + + // first name + // Example: Phil + FirstName string `json:"first_name,omitempty"` + + // id + // Example: 8c571470fef7db363994c8427c07b7bb + ID string `json:"id,omitempty"` + + // last name + // Example: Cranepool + LastName string `json:"last_name,omitempty"` + + // priv level + // Example: user + PrivLevel string `json:"priv_level,omitempty"` + + // timezone + // Example: America/Los_Angeles + Timezone string `json:"timezone,omitempty"` + + // username + // Example: phil + Username string `json:"username,omitempty"` +} + +// Validate validates this get account user response data items0 +func (m *GetAccountUserResponseDataItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account user response data items0 based on context it is used +func (m *GetAccountUserResponseDataItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountUserResponseDataItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountUserResponseDataItems0) UnmarshalBinary(b []byte) error { + var res GetAccountUserResponseDataItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/kazoo/kazoo_models/get_account_vm_box_response.go b/api/kazoo/kazoo_models/get_account_vm_box_response.go new file mode 100644 index 0000000..6b90976 --- /dev/null +++ b/api/kazoo/kazoo_models/get_account_vm_box_response.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package kazoo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GetAccountVMBoxResponse get account Vm box response +// +// swagger:model GetAccountVmBoxResponse +type GetAccountVMBoxResponse struct { + + // auth token + AuthToken string `json:"auth_token,omitempty"` + + // data + Data []*GetAccountVMBoxResponseDataItems0 `json:"data"` + + // node + // Example: dqZFtHthbelyE8MI6vU-LA + Node string `json:"node,omitempty"` + + // page size + // Example: 5 + PageSize float64 `json:"page_size,omitempty"` + + // request id + // Example: 0452de0d2fbef2cbccafaf7b3894bc0b + RequestID string `json:"request_id,omitempty"` + + // revision + // Example: 171c5eb1c826f66fe16cfb0669f55994 + Revision string `json:"revision,omitempty"` + + // status + // Example: success + Status string `json:"status,omitempty"` + + // timestamp + // Example: 2020-05-07T02:52:10Z + Timestamp string `json:"timestamp,omitempty"` + + // version + // Example: 4.3.103 + Version string `json:"version,omitempty"` +} + +// Validate validates this get account Vm box response +func (m *GetAccountVMBoxResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountVMBoxResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get account Vm box response based on the context it is used +func (m *GetAccountVMBoxResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAccountVMBoxResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountVMBoxResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountVMBoxResponse) UnmarshalBinary(b []byte) error { + var res GetAccountVMBoxResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetAccountVMBoxResponseDataItems0 get account VM box response data items0 +// +// swagger:model GetAccountVMBoxResponseDataItems0 +type GetAccountVMBoxResponseDataItems0 struct { + + // id + // Example: cbd3606fea91c9b834c5a1fc0efa1098 + ID string `json:"id,omitempty"` + + // mailbox + // Example: 2005 + Mailbox string `json:"mailbox,omitempty"` + + // messages + // Example: 12 + Messages float64 `json:"messages,omitempty"` + + // name + // Example: 2005 - Bill VM + Name string `json:"name,omitempty"` + + // owner id + // Example: f95626ebc2db4fd1a2b5ac5f6b11f7a3 + OwnerID string `json:"owner_id,omitempty"` +} + +// Validate validates this get account VM box response data items0 +func (m *GetAccountVMBoxResponseDataItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get account VM box response data items0 based on context it is used +func (m *GetAccountVMBoxResponseDataItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAccountVMBoxResponseDataItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAccountVMBoxResponseDataItems0) UnmarshalBinary(b []byte) error { + var res GetAccountVMBoxResponseDataItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/kazoo/kazoo_models/get_device_response.go b/api/kazoo/kazoo_models/get_device_response.go new file mode 100644 index 0000000..9b045e0 --- /dev/null +++ b/api/kazoo/kazoo_models/get_device_response.go @@ -0,0 +1,209 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package kazoo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GetDeviceResponse get device response +// +// swagger:model GetDeviceResponse +type GetDeviceResponse struct { + + // auth token + AuthToken string `json:"auth_token,omitempty"` + + // data + Data []*GetDeviceResponseDataItems0 `json:"data"` + + // node + // Example: dqZFtHthbelyE8MI6vU-LA + Node string `json:"node,omitempty"` + + // page size + // Example: 4 + PageSize float64 `json:"page_size,omitempty"` + + // request id + // Example: 29c9cccc07016866243a9dbd9481c88a + RequestID string `json:"request_id,omitempty"` + + // revision + // Example: 794a8debed3fca4330ba2373cd703773 + Revision string `json:"revision,omitempty"` + + // status + // Example: success + Status string `json:"status,omitempty"` + + // timestamp + // Example: 2020-05-07T01:20:21Z + Timestamp string `json:"timestamp,omitempty"` + + // version + // Example: 4.3.103 + Version string `json:"version,omitempty"` +} + +// Validate validates this get device response +func (m *GetDeviceResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetDeviceResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get device response based on the context it is used +func (m *GetDeviceResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetDeviceResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetDeviceResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetDeviceResponse) UnmarshalBinary(b []byte) error { + var res GetDeviceResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetDeviceResponseDataItems0 get device response data items0 +// +// swagger:model GetDeviceResponseDataItems0 +type GetDeviceResponseDataItems0 struct { + + // device type + // Example: softphone + DeviceType string `json:"device_type,omitempty"` + + // enabled + // Example: true + Enabled bool `json:"enabled,omitempty"` + + // id + // Example: f9627ff1bcca2d112931ee00dcfdb0c6 + ID string `json:"id,omitempty"` + + // mac address + // Example: string + MacAddress string `json:"mac_address,omitempty"` + + // name + // Example: 2007 - Vern iPhone Personal + Name string `json:"name,omitempty"` + + // owner id + // Example: c0a881b0dfbc7fc574cb67dcaf10879f + OwnerID string `json:"owner_id,omitempty"` + + // username + // Example: user_jaemid + Username string `json:"username,omitempty"` +} + +// Validate validates this get device response data items0 +func (m *GetDeviceResponseDataItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get device response data items0 based on context it is used +func (m *GetDeviceResponseDataItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetDeviceResponseDataItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetDeviceResponseDataItems0) UnmarshalBinary(b []byte) error { + var res GetDeviceResponseDataItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/kazoo/kazoo_models/get_kazoo_number_response.go b/api/kazoo/kazoo_models/get_kazoo_number_response.go new file mode 100644 index 0000000..9efb922 --- /dev/null +++ b/api/kazoo/kazoo_models/get_kazoo_number_response.go @@ -0,0 +1,181 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package kazoo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GetKazooNumberResponse get kazoo number response +// +// swagger:model GetKazooNumberResponse +type GetKazooNumberResponse struct { + + // auth token + AuthToken string `json:"auth_token,omitempty"` + + // data + Data []*GetKazooNumberResponseDataItems0 `json:"data"` + + // node + // Example: dqZFtHthbelyE8MI6vU-LA + Node string `json:"node,omitempty"` + + // request id + // Example: b310489bd3933c740590b2dcec953de8 + RequestID string `json:"request_id,omitempty"` + + // status + // Example: success + Status string `json:"status,omitempty"` + + // timestamp + // Example: 2020-05-07T02:30:03Z + Timestamp string `json:"timestamp,omitempty"` + + // version + // Example: 4.3.103 + Version string `json:"version,omitempty"` +} + +// Validate validates this get kazoo number response +func (m *GetKazooNumberResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetKazooNumberResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get kazoo number response based on the context it is used +func (m *GetKazooNumberResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetKazooNumberResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetKazooNumberResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetKazooNumberResponse) UnmarshalBinary(b []byte) error { + var res GetKazooNumberResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetKazooNumberResponseDataItems0 get kazoo number response data items0 +// +// swagger:model GetKazooNumberResponseDataItems0 +type GetKazooNumberResponseDataItems0 struct { + + // number + // Example: +15183486324 + Number string `json:"number,omitempty"` + + // state + // Example: discovery + State string `json:"state,omitempty"` +} + +// Validate validates this get kazoo number response data items0 +func (m *GetKazooNumberResponseDataItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get kazoo number response data items0 based on context it is used +func (m *GetKazooNumberResponseDataItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetKazooNumberResponseDataItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetKazooNumberResponseDataItems0) UnmarshalBinary(b []byte) error { + var res GetKazooNumberResponseDataItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/kazoo/kazoo_models/get_number_response.go b/api/kazoo/kazoo_models/get_number_response.go new file mode 100644 index 0000000..94e893f --- /dev/null +++ b/api/kazoo/kazoo_models/get_number_response.go @@ -0,0 +1,369 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package kazoo_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" +) + +// GetNumberResponse get number response +// +// swagger:model GetNumberResponse +type GetNumberResponse struct { + + // auth token + AuthToken string `json:"auth_token,omitempty"` + + // data + Data *GetNumberResponseData `json:"data,omitempty"` + + // node + // Example: dqZFtHthbelyE8MI6vU-LA + Node string `json:"node,omitempty"` + + // page size + // Example: 117 + PageSize float64 `json:"page_size,omitempty"` + + // request id + // Example: a73973839c028f42519105681482b64f + RequestID string `json:"request_id,omitempty"` + + // revision + // Example: 7c9f4f30f97ba288bad4f0f620e9e0bc + Revision string `json:"revision,omitempty"` + + // status + // Example: success + Status string `json:"status,omitempty"` + + // timestamp + // Example: 2020-05-07T01:56:53Z + Timestamp string `json:"timestamp,omitempty"` + + // version + // Example: 4.3.103 + Version string `json:"version,omitempty"` +} + +// Validate validates this get number response +func (m *GetNumberResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetNumberResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + if m.Data != nil { + if err := m.Data.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get number response based on the context it is used +func (m *GetNumberResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetNumberResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + if m.Data != nil { + if err := m.Data.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetNumberResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetNumberResponse) UnmarshalBinary(b []byte) error { + var res GetNumberResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetNumberResponseData get number response data +// +// swagger:model GetNumberResponseData +type GetNumberResponseData struct { + + // cascade quantity + // Example: 61 + CascadeQuantity float64 `json:"cascade_quantity,omitempty"` + + // numbers + Numbers *GetNumberResponseDataNumbers `json:"numbers,omitempty"` +} + +// Validate validates this get number response data +func (m *GetNumberResponseData) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateNumbers(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetNumberResponseData) validateNumbers(formats strfmt.Registry) error { + if swag.IsZero(m.Numbers) { // not required + return nil + } + + if m.Numbers != nil { + if err := m.Numbers.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "numbers") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get number response data based on the context it is used +func (m *GetNumberResponseData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateNumbers(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetNumberResponseData) contextValidateNumbers(ctx context.Context, formats strfmt.Registry) error { + + if m.Numbers != nil { + if err := m.Numbers.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "numbers") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetNumberResponseData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetNumberResponseData) UnmarshalBinary(b []byte) error { + var res GetNumberResponseData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetNumberResponseDataNumbers get number response data numbers +// +// swagger:model GetNumberResponseDataNumbers +type GetNumberResponseDataNumbers struct { + + // numberitem + Numberitem *GetNumberResponseDataNumbersNumberitem `json:"numberitem,omitempty"` +} + +// Validate validates this get number response data numbers +func (m *GetNumberResponseDataNumbers) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateNumberitem(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetNumberResponseDataNumbers) validateNumberitem(formats strfmt.Registry) error { + if swag.IsZero(m.Numberitem) { // not required + return nil + } + + if m.Numberitem != nil { + if err := m.Numberitem.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "numbers" + "." + "numberitem") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get number response data numbers based on the context it is used +func (m *GetNumberResponseDataNumbers) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateNumberitem(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetNumberResponseDataNumbers) contextValidateNumberitem(ctx context.Context, formats strfmt.Registry) error { + + if m.Numberitem != nil { + if err := m.Numberitem.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + "numbers" + "." + "numberitem") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetNumberResponseDataNumbers) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetNumberResponseDataNumbers) UnmarshalBinary(b []byte) error { + var res GetNumberResponseDataNumbers + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// GetNumberResponseDataNumbersNumberitem get number response data numbers numberitem +// +// swagger:model GetNumberResponseDataNumbersNumberitem +type GetNumberResponseDataNumbersNumberitem struct { + + // assigned to + // Example: a66f2b7a40944b744dcc63ca6f10f47a + AssignedTo string `json:"assigned_to,omitempty"` + + // created + // Example: 63714718327 + Created float64 `json:"created,omitempty"` + + // features + // Example: ["local"] + Features []string `json:"features"` + + // features available + // Example: ["cnam","e911","force_outbound","port","prepend","ringback"] + FeaturesAvailable []string `json:"features_available"` + + // state + // Example: in_service + State string `json:"state,omitempty"` + + // updated + // Example: 63755492918 + Updated float64 `json:"updated,omitempty"` +} + +// Validate validates this get number response data numbers numberitem +func (m *GetNumberResponseDataNumbersNumberitem) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get number response data numbers numberitem based on context it is used +func (m *GetNumberResponseDataNumbersNumberitem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetNumberResponseDataNumbersNumberitem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetNumberResponseDataNumbersNumberitem) UnmarshalBinary(b []byte) error { + var res GetNumberResponseDataNumbersNumberitem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/stash/stash_client/stash_client.go b/api/stash/stash_client/stash_client.go new file mode 100644 index 0000000..c192041 --- /dev/null +++ b/api/stash/stash_client/stash_client.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package stash_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" + + "code.tnxs.net/telnexus/lib/api/stash/stash_client/stash_pdf" +) + +// Default stash HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "stash.infra.tnxs.net:8080" + // 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 +var DefaultSchemes = []string{"http"} + +// NewHTTPClient creates a new stash HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Stash { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new stash HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Stash { + // ensure nullable parameters have default + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new stash client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Stash { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Stash) + cli.Transport = transport + cli.StashPdf = stash_pdf.New(transport, formats) + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// Stash is a client for stash +type Stash struct { + StashPdf stash_pdf.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Stash) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.StashPdf.SetTransport(transport) +} diff --git a/api/stash/stash_client/stash_pdf/post_pdfs_parameters.go b/api/stash/stash_client/stash_pdf/post_pdfs_parameters.go new file mode 100644 index 0000000..a2e6fd9 --- /dev/null +++ b/api/stash/stash_client/stash_pdf/post_pdfs_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package stash_pdf + +// 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/telnexus/lib/api/stash/stash_models" +) + +// NewPostPdfsParams creates a new PostPdfsParams 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 NewPostPdfsParams() *PostPdfsParams { + return &PostPdfsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostPdfsParamsWithTimeout creates a new PostPdfsParams object +// with the ability to set a timeout on a request. +func NewPostPdfsParamsWithTimeout(timeout time.Duration) *PostPdfsParams { + return &PostPdfsParams{ + timeout: timeout, + } +} + +// NewPostPdfsParamsWithContext creates a new PostPdfsParams object +// with the ability to set a context for a request. +func NewPostPdfsParamsWithContext(ctx context.Context) *PostPdfsParams { + return &PostPdfsParams{ + Context: ctx, + } +} + +// NewPostPdfsParamsWithHTTPClient creates a new PostPdfsParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostPdfsParamsWithHTTPClient(client *http.Client) *PostPdfsParams { + return &PostPdfsParams{ + HTTPClient: client, + } +} + +/* PostPdfsParams contains all the parameters to send to the API endpoint + for the post pdfs operation. + + Typically these are written to a http.Request. +*/ +type PostPdfsParams struct { + + /* PDFRequest. + + An array of new PDF records + */ + PDFRequest *stash_models.PDFRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post pdfs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostPdfsParams) WithDefaults() *PostPdfsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post pdfs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostPdfsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post pdfs params +func (o *PostPdfsParams) WithTimeout(timeout time.Duration) *PostPdfsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post pdfs params +func (o *PostPdfsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post pdfs params +func (o *PostPdfsParams) WithContext(ctx context.Context) *PostPdfsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post pdfs params +func (o *PostPdfsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post pdfs params +func (o *PostPdfsParams) WithHTTPClient(client *http.Client) *PostPdfsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post pdfs params +func (o *PostPdfsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPDFRequest adds the pDFRequest to the post pdfs params +func (o *PostPdfsParams) WithPDFRequest(pDFRequest *stash_models.PDFRequest) *PostPdfsParams { + o.SetPDFRequest(pDFRequest) + return o +} + +// SetPDFRequest adds the pDFRequest to the post pdfs params +func (o *PostPdfsParams) SetPDFRequest(pDFRequest *stash_models.PDFRequest) { + o.PDFRequest = pDFRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostPdfsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.PDFRequest != nil { + if err := r.SetBodyParam(o.PDFRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/stash/stash_client/stash_pdf/post_pdfs_responses.go b/api/stash/stash_client/stash_pdf/post_pdfs_responses.go new file mode 100644 index 0000000..0836ee4 --- /dev/null +++ b/api/stash/stash_client/stash_pdf/post_pdfs_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package stash_pdf + +// 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/telnexus/lib/api/stash/stash_models" +) + +// PostPdfsReader is a Reader for the PostPdfs structure. +type PostPdfsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostPdfsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostPdfsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostPdfsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostPdfsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostPdfsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostPdfsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostPdfsInternalServerError() + 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()) + } +} + +// NewPostPdfsOK creates a PostPdfsOK with default headers values +func NewPostPdfsOK() *PostPdfsOK { + return &PostPdfsOK{} +} + +/* PostPdfsOK describes a response with status code 200, with default header values. + +Rendered documents response +*/ +type PostPdfsOK struct { + Payload *stash_models.DocumentResponse +} + +func (o *PostPdfsOK) Error() string { + return fmt.Sprintf("[POST /pdfs][%d] postPdfsOK %+v", 200, o.Payload) +} +func (o *PostPdfsOK) GetPayload() *stash_models.DocumentResponse { + return o.Payload +} + +func (o *PostPdfsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(stash_models.DocumentResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPdfsUnauthorized creates a PostPdfsUnauthorized with default headers values +func NewPostPdfsUnauthorized() *PostPdfsUnauthorized { + return &PostPdfsUnauthorized{} +} + +/* PostPdfsUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostPdfsUnauthorized struct { + Payload *stash_models.Error +} + +func (o *PostPdfsUnauthorized) Error() string { + return fmt.Sprintf("[POST /pdfs][%d] postPdfsUnauthorized %+v", 401, o.Payload) +} +func (o *PostPdfsUnauthorized) GetPayload() *stash_models.Error { + return o.Payload +} + +func (o *PostPdfsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(stash_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPdfsForbidden creates a PostPdfsForbidden with default headers values +func NewPostPdfsForbidden() *PostPdfsForbidden { + return &PostPdfsForbidden{} +} + +/* PostPdfsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostPdfsForbidden struct { + Payload *stash_models.Error +} + +func (o *PostPdfsForbidden) Error() string { + return fmt.Sprintf("[POST /pdfs][%d] postPdfsForbidden %+v", 403, o.Payload) +} +func (o *PostPdfsForbidden) GetPayload() *stash_models.Error { + return o.Payload +} + +func (o *PostPdfsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(stash_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPdfsNotFound creates a PostPdfsNotFound with default headers values +func NewPostPdfsNotFound() *PostPdfsNotFound { + return &PostPdfsNotFound{} +} + +/* PostPdfsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostPdfsNotFound struct { + Payload *stash_models.Error +} + +func (o *PostPdfsNotFound) Error() string { + return fmt.Sprintf("[POST /pdfs][%d] postPdfsNotFound %+v", 404, o.Payload) +} +func (o *PostPdfsNotFound) GetPayload() *stash_models.Error { + return o.Payload +} + +func (o *PostPdfsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(stash_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPdfsUnprocessableEntity creates a PostPdfsUnprocessableEntity with default headers values +func NewPostPdfsUnprocessableEntity() *PostPdfsUnprocessableEntity { + return &PostPdfsUnprocessableEntity{} +} + +/* PostPdfsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostPdfsUnprocessableEntity struct { + Payload *stash_models.Error +} + +func (o *PostPdfsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /pdfs][%d] postPdfsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PostPdfsUnprocessableEntity) GetPayload() *stash_models.Error { + return o.Payload +} + +func (o *PostPdfsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(stash_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPdfsInternalServerError creates a PostPdfsInternalServerError with default headers values +func NewPostPdfsInternalServerError() *PostPdfsInternalServerError { + return &PostPdfsInternalServerError{} +} + +/* PostPdfsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostPdfsInternalServerError struct { + Payload *stash_models.Error +} + +func (o *PostPdfsInternalServerError) Error() string { + return fmt.Sprintf("[POST /pdfs][%d] postPdfsInternalServerError %+v", 500, o.Payload) +} +func (o *PostPdfsInternalServerError) GetPayload() *stash_models.Error { + return o.Payload +} + +func (o *PostPdfsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(stash_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/stash/stash_client/stash_pdf/stash_pdf_client.go b/api/stash/stash_client/stash_pdf/stash_pdf_client.go new file mode 100644 index 0000000..f9c4602 --- /dev/null +++ b/api/stash/stash_client/stash_pdf/stash_pdf_client.go @@ -0,0 +1,86 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package stash_pdf + +// 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 stash pdf API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for stash pdf 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 { + PostPdfs(params *PostPdfsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPdfsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + PostPdfs creates new p d fs + + Store new PDFs +*/ +func (a *Client) PostPdfs(params *PostPdfsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPdfsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostPdfsParams() + } + op := &runtime.ClientOperation{ + ID: "postPdfs", + Method: "POST", + PathPattern: "/pdfs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostPdfsReader{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.(*PostPdfsOK) + 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 postPdfs: 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 +} diff --git a/api/stash/stash_models/document.go b/api/stash/stash_models/document.go new file mode 100644 index 0000000..97ef4a1 --- /dev/null +++ b/api/stash/stash_models/document.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package stash_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" +) + +// Document document +// +// swagger:model Document +type Document struct { + + // filename + Filename string `json:"Filename,omitempty"` + + // ID + ID string `json:"ID,omitempty"` + + // parent ID + ParentID string `json:"ParentID,omitempty"` + + // saga type + SagaType string `json:"SagaType,omitempty"` + + // title + Title string `json:"Title,omitempty"` + + // URI + URI string `json:"URI,omitempty"` +} + +// Validate validates this document +func (m *Document) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this document based on context it is used +func (m *Document) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Document) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Document) UnmarshalBinary(b []byte) error { + var res Document + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/stash/stash_models/document_response.go b/api/stash/stash_models/document_response.go new file mode 100644 index 0000000..1208241 --- /dev/null +++ b/api/stash/stash_models/document_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package stash_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DocumentResponse An array of rendered documents +// +// swagger:model DocumentResponse +type DocumentResponse struct { + + // data + Data []*Document `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this document response +func (m *DocumentResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DocumentResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DocumentResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this document response based on the context it is used +func (m *DocumentResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DocumentResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DocumentResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DocumentResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DocumentResponse) UnmarshalBinary(b []byte) error { + var res DocumentResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/stash/stash_models/error.go b/api/stash/stash_models/error.go new file mode 100644 index 0000000..c9d7366 --- /dev/null +++ b/api/stash/stash_models/error.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package stash_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" +) + +// Error error +// +// swagger:model Error +type Error struct { + + // code + Code int64 `json:"Code,omitempty"` + + // fields + Fields string `json:"Fields,omitempty"` + + // message + Message string `json:"Message,omitempty"` +} + +// Validate validates this error +func (m *Error) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this error based on context it is used +func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Error) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Error) UnmarshalBinary(b []byte) error { + var res Error + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/stash/stash_models/new_p_d_f.go b/api/stash/stash_models/new_p_d_f.go new file mode 100644 index 0000000..1a63a01 --- /dev/null +++ b/api/stash/stash_models/new_p_d_f.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package stash_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" +) + +// NewPDF new p d f +// +// swagger:model NewPDF +type NewPDF struct { + + // Description + Description string `json:"Description,omitempty"` + + // Filename only + Filename string `json:"Filename,omitempty"` + + // The HTML data in text format + HTML string `json:"HTML,omitempty"` + + // Last Accessed By + LastAccessedByID string `json:"LastAccessedByID,omitempty"` + + // This document's financial object origination + ObjectType string `json:"ObjectType,omitempty"` + + // User who created the PDF + OwnerID string `json:"OwnerID,omitempty"` + + // ID of the record that owns this PDF + ParentID string `json:"ParentID,omitempty"` + + // External reference if any + Ref string `json:"Ref,omitempty"` + + // Document descriptive title + Title string `json:"Title,omitempty"` +} + +// Validate validates this new p d f +func (m *NewPDF) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this new p d f based on context it is used +func (m *NewPDF) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *NewPDF) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NewPDF) UnmarshalBinary(b []byte) error { + var res NewPDF + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/stash/stash_models/p_d_f_request.go b/api/stash/stash_models/p_d_f_request.go new file mode 100644 index 0000000..a9e9037 --- /dev/null +++ b/api/stash/stash_models/p_d_f_request.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package stash_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PDFRequest p d f request +// +// swagger:model PDFRequest +type PDFRequest struct { + + // data + Data []*NewPDF `json:"Data"` + + // meta + Meta *RequestMeta `json:"Meta,omitempty"` +} + +// Validate validates this p d f request +func (m *PDFRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PDFRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PDFRequest) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this p d f request based on the context it is used +func (m *PDFRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PDFRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PDFRequest) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PDFRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PDFRequest) UnmarshalBinary(b []byte) error { + var res PDFRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/stash/stash_models/request_meta.go b/api/stash/stash_models/request_meta.go new file mode 100644 index 0000000..b74f07e --- /dev/null +++ b/api/stash/stash_models/request_meta.go @@ -0,0 +1,75 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package stash_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RequestMeta request meta +// +// swagger:model RequestMeta +type RequestMeta struct { + + // Telnexus Account Number of the Reseller or OEM + // Required: true + TelnexusAccount *string `json:"TelnexusAccount"` +} + +// Validate validates this request meta +func (m *RequestMeta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTelnexusAccount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RequestMeta) validateTelnexusAccount(formats strfmt.Registry) error { + + if err := validate.Required("TelnexusAccount", "body", m.TelnexusAccount); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this request meta based on context it is used +func (m *RequestMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RequestMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RequestMeta) UnmarshalBinary(b []byte) error { + var res RequestMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/stash/stash_models/response_meta.go b/api/stash/stash_models/response_meta.go new file mode 100644 index 0000000..84f0b37 --- /dev/null +++ b/api/stash/stash_models/response_meta.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package stash_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" +) + +// ResponseMeta response meta +// +// swagger:model ResponseMeta +type ResponseMeta struct { + + // Microservice Contact Info + Contact string `json:"Contact,omitempty"` + + // Copyright Info + Copyright string `json:"Copyright,omitempty"` + + // License Information and Restrictions + License string `json:"License,omitempty"` + + // Operation ID + OperationID string `json:"OperationID,omitempty"` + + // Request IP Address + RequestIP string `json:"RequestIP,omitempty"` + + // Request Type + RequestType string `json:"RequestType,omitempty"` + + // Request URL + RequestURL string `json:"RequestURL,omitempty"` + + // Data Server Info + ServerInfo string `json:"ServerInfo,omitempty"` + + // Data Server Response Time (ms) + ServerResponseTime string `json:"ServerResponseTime,omitempty"` + + // Backend Server Timestamp + ServerTimestamp string `json:"ServerTimestamp,omitempty"` + + // Telnexus Account Number used for recording transactions + TelnexusAccount string `json:"TelnexusAccount,omitempty"` +} + +// Validate validates this response meta +func (m *ResponseMeta) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this response meta based on context it is used +func (m *ResponseMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ResponseMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ResponseMeta) UnmarshalBinary(b []byte) error { + var res ResponseMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_client/authority/authority_client.go b/api/voip/voip_client/authority/authority_client.go new file mode 100644 index 0000000..697d1f5 --- /dev/null +++ b/api/voip/voip_client/authority/authority_client.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package authority + +// 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 authority API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for authority 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 { + GetAuthorities(params *GetAuthoritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAuthoritiesOK, error) + + PostAuthorities(params *PostAuthoritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAuthoritiesOK, error) + + PutAuthorities(params *PutAuthoritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutAuthoritiesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetAuthorities gets a list of authorities + + Return a list of available Authorities +*/ +func (a *Client) GetAuthorities(params *GetAuthoritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAuthoritiesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAuthoritiesParams() + } + op := &runtime.ClientOperation{ + ID: "getAuthorities", + Method: "GET", + PathPattern: "/authorities", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetAuthoritiesReader{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.(*GetAuthoritiesOK) + 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 getAuthorities: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostAuthorities adds new authorities + + Create new Authorities +*/ +func (a *Client) PostAuthorities(params *PostAuthoritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAuthoritiesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostAuthoritiesParams() + } + op := &runtime.ClientOperation{ + ID: "postAuthorities", + Method: "POST", + PathPattern: "/authorities", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostAuthoritiesReader{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.(*PostAuthoritiesOK) + 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 postAuthorities: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutAuthorities updates authorities + + Update fields in an Authority record identified by Telnexus Id +*/ +func (a *Client) PutAuthorities(params *PutAuthoritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutAuthoritiesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutAuthoritiesParams() + } + op := &runtime.ClientOperation{ + ID: "putAuthorities", + Method: "PUT", + PathPattern: "/authorities", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutAuthoritiesReader{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.(*PutAuthoritiesOK) + 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 putAuthorities: 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 +} diff --git a/api/voip/voip_client/authority/get_authorities_parameters.go b/api/voip/voip_client/authority/get_authorities_parameters.go new file mode 100644 index 0000000..983a99a --- /dev/null +++ b/api/voip/voip_client/authority/get_authorities_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package authority + +// 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" +) + +// NewGetAuthoritiesParams creates a new GetAuthoritiesParams 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 NewGetAuthoritiesParams() *GetAuthoritiesParams { + return &GetAuthoritiesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAuthoritiesParamsWithTimeout creates a new GetAuthoritiesParams object +// with the ability to set a timeout on a request. +func NewGetAuthoritiesParamsWithTimeout(timeout time.Duration) *GetAuthoritiesParams { + return &GetAuthoritiesParams{ + timeout: timeout, + } +} + +// NewGetAuthoritiesParamsWithContext creates a new GetAuthoritiesParams object +// with the ability to set a context for a request. +func NewGetAuthoritiesParamsWithContext(ctx context.Context) *GetAuthoritiesParams { + return &GetAuthoritiesParams{ + Context: ctx, + } +} + +// NewGetAuthoritiesParamsWithHTTPClient creates a new GetAuthoritiesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAuthoritiesParamsWithHTTPClient(client *http.Client) *GetAuthoritiesParams { + return &GetAuthoritiesParams{ + HTTPClient: client, + } +} + +/* GetAuthoritiesParams contains all the parameters to send to the API endpoint + for the get authorities operation. + + Typically these are written to a http.Request. +*/ +type GetAuthoritiesParams struct { + + /* AuthorityID. + + Telnexus Id of the Authority to be retrieved + */ + AuthorityID *string + + /* Limit. + + How many objects to return at one time (max 300, default 100) + + Format: int64 + Default: 100 + */ + Limit *int64 + + /* Offset. + + How many objects to skip? (default 0) + + Format: int64 + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get authorities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAuthoritiesParams) WithDefaults() *GetAuthoritiesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get authorities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAuthoritiesParams) SetDefaults() { + var ( + limitDefault = int64(100) + + offsetDefault = int64(0) + ) + + val := GetAuthoritiesParams{ + Limit: &limitDefault, + Offset: &offsetDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the get authorities params +func (o *GetAuthoritiesParams) WithTimeout(timeout time.Duration) *GetAuthoritiesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get authorities params +func (o *GetAuthoritiesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get authorities params +func (o *GetAuthoritiesParams) WithContext(ctx context.Context) *GetAuthoritiesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get authorities params +func (o *GetAuthoritiesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get authorities params +func (o *GetAuthoritiesParams) WithHTTPClient(client *http.Client) *GetAuthoritiesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get authorities params +func (o *GetAuthoritiesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAuthorityID adds the authorityID to the get authorities params +func (o *GetAuthoritiesParams) WithAuthorityID(authorityID *string) *GetAuthoritiesParams { + o.SetAuthorityID(authorityID) + return o +} + +// SetAuthorityID adds the authorityId to the get authorities params +func (o *GetAuthoritiesParams) SetAuthorityID(authorityID *string) { + o.AuthorityID = authorityID +} + +// WithLimit adds the limit to the get authorities params +func (o *GetAuthoritiesParams) WithLimit(limit *int64) *GetAuthoritiesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get authorities params +func (o *GetAuthoritiesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get authorities params +func (o *GetAuthoritiesParams) WithOffset(offset *int64) *GetAuthoritiesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get authorities params +func (o *GetAuthoritiesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAuthoritiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AuthorityID != nil { + + // query param authorityId + var qrAuthorityID string + + if o.AuthorityID != nil { + qrAuthorityID = *o.AuthorityID + } + qAuthorityID := qrAuthorityID + if qAuthorityID != "" { + + if err := r.SetQueryParam("authorityId", qAuthorityID); 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 +} diff --git a/api/voip/voip_client/authority/get_authorities_responses.go b/api/voip/voip_client/authority/get_authorities_responses.go new file mode 100644 index 0000000..d21bf2d --- /dev/null +++ b/api/voip/voip_client/authority/get_authorities_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package authority + +// 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/telnexus/lib/api/voip/voip_models" +) + +// GetAuthoritiesReader is a Reader for the GetAuthorities structure. +type GetAuthoritiesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAuthoritiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAuthoritiesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetAuthoritiesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetAuthoritiesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetAuthoritiesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetAuthoritiesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetAuthoritiesInternalServerError() + 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()) + } +} + +// NewGetAuthoritiesOK creates a GetAuthoritiesOK with default headers values +func NewGetAuthoritiesOK() *GetAuthoritiesOK { + return &GetAuthoritiesOK{} +} + +/* GetAuthoritiesOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of Authority objects +*/ +type GetAuthoritiesOK struct { + Payload *voip_models.AuthorityResponse +} + +func (o *GetAuthoritiesOK) Error() string { + return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesOK %+v", 200, o.Payload) +} +func (o *GetAuthoritiesOK) GetPayload() *voip_models.AuthorityResponse { + return o.Payload +} + +func (o *GetAuthoritiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.AuthorityResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAuthoritiesUnauthorized creates a GetAuthoritiesUnauthorized with default headers values +func NewGetAuthoritiesUnauthorized() *GetAuthoritiesUnauthorized { + return &GetAuthoritiesUnauthorized{} +} + +/* GetAuthoritiesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetAuthoritiesUnauthorized struct { + Payload *voip_models.Error +} + +func (o *GetAuthoritiesUnauthorized) Error() string { + return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesUnauthorized %+v", 401, o.Payload) +} +func (o *GetAuthoritiesUnauthorized) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetAuthoritiesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAuthoritiesForbidden creates a GetAuthoritiesForbidden with default headers values +func NewGetAuthoritiesForbidden() *GetAuthoritiesForbidden { + return &GetAuthoritiesForbidden{} +} + +/* GetAuthoritiesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetAuthoritiesForbidden struct { + Payload *voip_models.Error +} + +func (o *GetAuthoritiesForbidden) Error() string { + return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesForbidden %+v", 403, o.Payload) +} +func (o *GetAuthoritiesForbidden) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetAuthoritiesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAuthoritiesNotFound creates a GetAuthoritiesNotFound with default headers values +func NewGetAuthoritiesNotFound() *GetAuthoritiesNotFound { + return &GetAuthoritiesNotFound{} +} + +/* GetAuthoritiesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetAuthoritiesNotFound struct { + Payload *voip_models.Error +} + +func (o *GetAuthoritiesNotFound) Error() string { + return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesNotFound %+v", 404, o.Payload) +} +func (o *GetAuthoritiesNotFound) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetAuthoritiesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAuthoritiesUnprocessableEntity creates a GetAuthoritiesUnprocessableEntity with default headers values +func NewGetAuthoritiesUnprocessableEntity() *GetAuthoritiesUnprocessableEntity { + return &GetAuthoritiesUnprocessableEntity{} +} + +/* GetAuthoritiesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetAuthoritiesUnprocessableEntity struct { + Payload *voip_models.Error +} + +func (o *GetAuthoritiesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetAuthoritiesUnprocessableEntity) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetAuthoritiesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAuthoritiesInternalServerError creates a GetAuthoritiesInternalServerError with default headers values +func NewGetAuthoritiesInternalServerError() *GetAuthoritiesInternalServerError { + return &GetAuthoritiesInternalServerError{} +} + +/* GetAuthoritiesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetAuthoritiesInternalServerError struct { + Payload *voip_models.Error +} + +func (o *GetAuthoritiesInternalServerError) Error() string { + return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesInternalServerError %+v", 500, o.Payload) +} +func (o *GetAuthoritiesInternalServerError) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetAuthoritiesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/voip/voip_client/authority/post_authorities_parameters.go b/api/voip/voip_client/authority/post_authorities_parameters.go new file mode 100644 index 0000000..b57d22d --- /dev/null +++ b/api/voip/voip_client/authority/post_authorities_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package authority + +// 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/telnexus/lib/api/voip/voip_models" +) + +// NewPostAuthoritiesParams creates a new PostAuthoritiesParams 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 NewPostAuthoritiesParams() *PostAuthoritiesParams { + return &PostAuthoritiesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostAuthoritiesParamsWithTimeout creates a new PostAuthoritiesParams object +// with the ability to set a timeout on a request. +func NewPostAuthoritiesParamsWithTimeout(timeout time.Duration) *PostAuthoritiesParams { + return &PostAuthoritiesParams{ + timeout: timeout, + } +} + +// NewPostAuthoritiesParamsWithContext creates a new PostAuthoritiesParams object +// with the ability to set a context for a request. +func NewPostAuthoritiesParamsWithContext(ctx context.Context) *PostAuthoritiesParams { + return &PostAuthoritiesParams{ + Context: ctx, + } +} + +// NewPostAuthoritiesParamsWithHTTPClient creates a new PostAuthoritiesParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostAuthoritiesParamsWithHTTPClient(client *http.Client) *PostAuthoritiesParams { + return &PostAuthoritiesParams{ + HTTPClient: client, + } +} + +/* PostAuthoritiesParams contains all the parameters to send to the API endpoint + for the post authorities operation. + + Typically these are written to a http.Request. +*/ +type PostAuthoritiesParams struct { + + /* AuthorityRequest. + + A request with an array of Authority Objects + */ + AuthorityRequest *voip_models.AuthorityRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post authorities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostAuthoritiesParams) WithDefaults() *PostAuthoritiesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post authorities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostAuthoritiesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post authorities params +func (o *PostAuthoritiesParams) WithTimeout(timeout time.Duration) *PostAuthoritiesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post authorities params +func (o *PostAuthoritiesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post authorities params +func (o *PostAuthoritiesParams) WithContext(ctx context.Context) *PostAuthoritiesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post authorities params +func (o *PostAuthoritiesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post authorities params +func (o *PostAuthoritiesParams) WithHTTPClient(client *http.Client) *PostAuthoritiesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post authorities params +func (o *PostAuthoritiesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAuthorityRequest adds the authorityRequest to the post authorities params +func (o *PostAuthoritiesParams) WithAuthorityRequest(authorityRequest *voip_models.AuthorityRequest) *PostAuthoritiesParams { + o.SetAuthorityRequest(authorityRequest) + return o +} + +// SetAuthorityRequest adds the authorityRequest to the post authorities params +func (o *PostAuthoritiesParams) SetAuthorityRequest(authorityRequest *voip_models.AuthorityRequest) { + o.AuthorityRequest = authorityRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostAuthoritiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.AuthorityRequest != nil { + if err := r.SetBodyParam(o.AuthorityRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/voip/voip_client/authority/post_authorities_responses.go b/api/voip/voip_client/authority/post_authorities_responses.go new file mode 100644 index 0000000..ee5fe75 --- /dev/null +++ b/api/voip/voip_client/authority/post_authorities_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package authority + +// 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/telnexus/lib/api/voip/voip_models" +) + +// PostAuthoritiesReader is a Reader for the PostAuthorities structure. +type PostAuthoritiesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostAuthoritiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostAuthoritiesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostAuthoritiesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostAuthoritiesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostAuthoritiesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostAuthoritiesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostAuthoritiesInternalServerError() + 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()) + } +} + +// NewPostAuthoritiesOK creates a PostAuthoritiesOK with default headers values +func NewPostAuthoritiesOK() *PostAuthoritiesOK { + return &PostAuthoritiesOK{} +} + +/* PostAuthoritiesOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of Authority objects +*/ +type PostAuthoritiesOK struct { + Payload *voip_models.AuthorityResponse +} + +func (o *PostAuthoritiesOK) Error() string { + return fmt.Sprintf("[POST /authorities][%d] postAuthoritiesOK %+v", 200, o.Payload) +} +func (o *PostAuthoritiesOK) GetPayload() *voip_models.AuthorityResponse { + return o.Payload +} + +func (o *PostAuthoritiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.AuthorityResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAuthoritiesUnauthorized creates a PostAuthoritiesUnauthorized with default headers values +func NewPostAuthoritiesUnauthorized() *PostAuthoritiesUnauthorized { + return &PostAuthoritiesUnauthorized{} +} + +/* PostAuthoritiesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostAuthoritiesUnauthorized struct { + Payload *voip_models.Error +} + +func (o *PostAuthoritiesUnauthorized) Error() string { + return fmt.Sprintf("[POST /authorities][%d] postAuthoritiesUnauthorized %+v", 401, o.Payload) +} +func (o *PostAuthoritiesUnauthorized) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostAuthoritiesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAuthoritiesForbidden creates a PostAuthoritiesForbidden with default headers values +func NewPostAuthoritiesForbidden() *PostAuthoritiesForbidden { + return &PostAuthoritiesForbidden{} +} + +/* PostAuthoritiesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostAuthoritiesForbidden struct { + Payload *voip_models.Error +} + +func (o *PostAuthoritiesForbidden) Error() string { + return fmt.Sprintf("[POST /authorities][%d] postAuthoritiesForbidden %+v", 403, o.Payload) +} +func (o *PostAuthoritiesForbidden) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostAuthoritiesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAuthoritiesNotFound creates a PostAuthoritiesNotFound with default headers values +func NewPostAuthoritiesNotFound() *PostAuthoritiesNotFound { + return &PostAuthoritiesNotFound{} +} + +/* PostAuthoritiesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostAuthoritiesNotFound struct { + Payload *voip_models.Error +} + +func (o *PostAuthoritiesNotFound) Error() string { + return fmt.Sprintf("[POST /authorities][%d] postAuthoritiesNotFound %+v", 404, o.Payload) +} +func (o *PostAuthoritiesNotFound) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostAuthoritiesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAuthoritiesUnprocessableEntity creates a PostAuthoritiesUnprocessableEntity with default headers values +func NewPostAuthoritiesUnprocessableEntity() *PostAuthoritiesUnprocessableEntity { + return &PostAuthoritiesUnprocessableEntity{} +} + +/* PostAuthoritiesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostAuthoritiesUnprocessableEntity struct { + Payload *voip_models.Error +} + +func (o *PostAuthoritiesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /authorities][%d] postAuthoritiesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PostAuthoritiesUnprocessableEntity) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostAuthoritiesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAuthoritiesInternalServerError creates a PostAuthoritiesInternalServerError with default headers values +func NewPostAuthoritiesInternalServerError() *PostAuthoritiesInternalServerError { + return &PostAuthoritiesInternalServerError{} +} + +/* PostAuthoritiesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostAuthoritiesInternalServerError struct { + Payload *voip_models.Error +} + +func (o *PostAuthoritiesInternalServerError) Error() string { + return fmt.Sprintf("[POST /authorities][%d] postAuthoritiesInternalServerError %+v", 500, o.Payload) +} +func (o *PostAuthoritiesInternalServerError) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostAuthoritiesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/voip/voip_client/authority/put_authorities_parameters.go b/api/voip/voip_client/authority/put_authorities_parameters.go new file mode 100644 index 0000000..cef7b90 --- /dev/null +++ b/api/voip/voip_client/authority/put_authorities_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package authority + +// 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/telnexus/lib/api/voip/voip_models" +) + +// NewPutAuthoritiesParams creates a new PutAuthoritiesParams 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 NewPutAuthoritiesParams() *PutAuthoritiesParams { + return &PutAuthoritiesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPutAuthoritiesParamsWithTimeout creates a new PutAuthoritiesParams object +// with the ability to set a timeout on a request. +func NewPutAuthoritiesParamsWithTimeout(timeout time.Duration) *PutAuthoritiesParams { + return &PutAuthoritiesParams{ + timeout: timeout, + } +} + +// NewPutAuthoritiesParamsWithContext creates a new PutAuthoritiesParams object +// with the ability to set a context for a request. +func NewPutAuthoritiesParamsWithContext(ctx context.Context) *PutAuthoritiesParams { + return &PutAuthoritiesParams{ + Context: ctx, + } +} + +// NewPutAuthoritiesParamsWithHTTPClient creates a new PutAuthoritiesParams object +// with the ability to set a custom HTTPClient for a request. +func NewPutAuthoritiesParamsWithHTTPClient(client *http.Client) *PutAuthoritiesParams { + return &PutAuthoritiesParams{ + HTTPClient: client, + } +} + +/* PutAuthoritiesParams contains all the parameters to send to the API endpoint + for the put authorities operation. + + Typically these are written to a http.Request. +*/ +type PutAuthoritiesParams struct { + + /* AuthorityRequest. + + A request with an array of Authority Objects + */ + AuthorityRequest *voip_models.AuthorityRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put authorities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutAuthoritiesParams) WithDefaults() *PutAuthoritiesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put authorities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutAuthoritiesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the put authorities params +func (o *PutAuthoritiesParams) WithTimeout(timeout time.Duration) *PutAuthoritiesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put authorities params +func (o *PutAuthoritiesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put authorities params +func (o *PutAuthoritiesParams) WithContext(ctx context.Context) *PutAuthoritiesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put authorities params +func (o *PutAuthoritiesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put authorities params +func (o *PutAuthoritiesParams) WithHTTPClient(client *http.Client) *PutAuthoritiesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put authorities params +func (o *PutAuthoritiesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAuthorityRequest adds the authorityRequest to the put authorities params +func (o *PutAuthoritiesParams) WithAuthorityRequest(authorityRequest *voip_models.AuthorityRequest) *PutAuthoritiesParams { + o.SetAuthorityRequest(authorityRequest) + return o +} + +// SetAuthorityRequest adds the authorityRequest to the put authorities params +func (o *PutAuthoritiesParams) SetAuthorityRequest(authorityRequest *voip_models.AuthorityRequest) { + o.AuthorityRequest = authorityRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutAuthoritiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.AuthorityRequest != nil { + if err := r.SetBodyParam(o.AuthorityRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/voip/voip_client/authority/put_authorities_responses.go b/api/voip/voip_client/authority/put_authorities_responses.go new file mode 100644 index 0000000..4b34cf1 --- /dev/null +++ b/api/voip/voip_client/authority/put_authorities_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package authority + +// 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/telnexus/lib/api/voip/voip_models" +) + +// PutAuthoritiesReader is a Reader for the PutAuthorities structure. +type PutAuthoritiesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutAuthoritiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutAuthoritiesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutAuthoritiesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutAuthoritiesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutAuthoritiesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutAuthoritiesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutAuthoritiesInternalServerError() + 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()) + } +} + +// NewPutAuthoritiesOK creates a PutAuthoritiesOK with default headers values +func NewPutAuthoritiesOK() *PutAuthoritiesOK { + return &PutAuthoritiesOK{} +} + +/* PutAuthoritiesOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of Authority objects +*/ +type PutAuthoritiesOK struct { + Payload *voip_models.AuthorityResponse +} + +func (o *PutAuthoritiesOK) Error() string { + return fmt.Sprintf("[PUT /authorities][%d] putAuthoritiesOK %+v", 200, o.Payload) +} +func (o *PutAuthoritiesOK) GetPayload() *voip_models.AuthorityResponse { + return o.Payload +} + +func (o *PutAuthoritiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.AuthorityResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAuthoritiesUnauthorized creates a PutAuthoritiesUnauthorized with default headers values +func NewPutAuthoritiesUnauthorized() *PutAuthoritiesUnauthorized { + return &PutAuthoritiesUnauthorized{} +} + +/* PutAuthoritiesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutAuthoritiesUnauthorized struct { + Payload *voip_models.Error +} + +func (o *PutAuthoritiesUnauthorized) Error() string { + return fmt.Sprintf("[PUT /authorities][%d] putAuthoritiesUnauthorized %+v", 401, o.Payload) +} +func (o *PutAuthoritiesUnauthorized) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutAuthoritiesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAuthoritiesForbidden creates a PutAuthoritiesForbidden with default headers values +func NewPutAuthoritiesForbidden() *PutAuthoritiesForbidden { + return &PutAuthoritiesForbidden{} +} + +/* PutAuthoritiesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PutAuthoritiesForbidden struct { + Payload *voip_models.Error +} + +func (o *PutAuthoritiesForbidden) Error() string { + return fmt.Sprintf("[PUT /authorities][%d] putAuthoritiesForbidden %+v", 403, o.Payload) +} +func (o *PutAuthoritiesForbidden) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutAuthoritiesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAuthoritiesNotFound creates a PutAuthoritiesNotFound with default headers values +func NewPutAuthoritiesNotFound() *PutAuthoritiesNotFound { + return &PutAuthoritiesNotFound{} +} + +/* PutAuthoritiesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PutAuthoritiesNotFound struct { + Payload *voip_models.Error +} + +func (o *PutAuthoritiesNotFound) Error() string { + return fmt.Sprintf("[PUT /authorities][%d] putAuthoritiesNotFound %+v", 404, o.Payload) +} +func (o *PutAuthoritiesNotFound) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutAuthoritiesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAuthoritiesUnprocessableEntity creates a PutAuthoritiesUnprocessableEntity with default headers values +func NewPutAuthoritiesUnprocessableEntity() *PutAuthoritiesUnprocessableEntity { + return &PutAuthoritiesUnprocessableEntity{} +} + +/* PutAuthoritiesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutAuthoritiesUnprocessableEntity struct { + Payload *voip_models.Error +} + +func (o *PutAuthoritiesUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /authorities][%d] putAuthoritiesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PutAuthoritiesUnprocessableEntity) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutAuthoritiesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAuthoritiesInternalServerError creates a PutAuthoritiesInternalServerError with default headers values +func NewPutAuthoritiesInternalServerError() *PutAuthoritiesInternalServerError { + return &PutAuthoritiesInternalServerError{} +} + +/* PutAuthoritiesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PutAuthoritiesInternalServerError struct { + Payload *voip_models.Error +} + +func (o *PutAuthoritiesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /authorities][%d] putAuthoritiesInternalServerError %+v", 500, o.Payload) +} +func (o *PutAuthoritiesInternalServerError) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutAuthoritiesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/voip/voip_client/endpoint/endpoint_client.go b/api/voip/voip_client/endpoint/endpoint_client.go new file mode 100644 index 0000000..543cc6d --- /dev/null +++ b/api/voip/voip_client/endpoint/endpoint_client.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package endpoint + +// 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 endpoint API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for endpoint 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 { + GetEndpoints(params *GetEndpointsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetEndpointsOK, error) + + PostEndpoints(params *PostEndpointsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostEndpointsOK, error) + + PutEndpoints(params *PutEndpointsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutEndpointsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetEndpoints gets a list of endpoints + + Return a list of available Endpoint entities +*/ +func (a *Client) GetEndpoints(params *GetEndpointsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetEndpointsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetEndpointsParams() + } + op := &runtime.ClientOperation{ + ID: "getEndpoints", + Method: "GET", + PathPattern: "/endpoints", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetEndpointsReader{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.(*GetEndpointsOK) + 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 getEndpoints: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostEndpoints adds new endpoints + + Create new Endpoints +*/ +func (a *Client) PostEndpoints(params *PostEndpointsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostEndpointsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostEndpointsParams() + } + op := &runtime.ClientOperation{ + ID: "postEndpoints", + Method: "POST", + PathPattern: "/endpoints", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostEndpointsReader{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.(*PostEndpointsOK) + 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 postEndpoints: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutEndpoints updates endpoints + + Update fields in Endpoint records identified by Telnexus Id +*/ +func (a *Client) PutEndpoints(params *PutEndpointsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutEndpointsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutEndpointsParams() + } + op := &runtime.ClientOperation{ + ID: "putEndpoints", + Method: "PUT", + PathPattern: "/endpoints", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutEndpointsReader{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.(*PutEndpointsOK) + 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 putEndpoints: 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 +} diff --git a/api/voip/voip_client/endpoint/get_endpoints_parameters.go b/api/voip/voip_client/endpoint/get_endpoints_parameters.go new file mode 100644 index 0000000..734a9b7 --- /dev/null +++ b/api/voip/voip_client/endpoint/get_endpoints_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package endpoint + +// 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" +) + +// NewGetEndpointsParams creates a new GetEndpointsParams 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 NewGetEndpointsParams() *GetEndpointsParams { + return &GetEndpointsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetEndpointsParamsWithTimeout creates a new GetEndpointsParams object +// with the ability to set a timeout on a request. +func NewGetEndpointsParamsWithTimeout(timeout time.Duration) *GetEndpointsParams { + return &GetEndpointsParams{ + timeout: timeout, + } +} + +// NewGetEndpointsParamsWithContext creates a new GetEndpointsParams object +// with the ability to set a context for a request. +func NewGetEndpointsParamsWithContext(ctx context.Context) *GetEndpointsParams { + return &GetEndpointsParams{ + Context: ctx, + } +} + +// NewGetEndpointsParamsWithHTTPClient creates a new GetEndpointsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetEndpointsParamsWithHTTPClient(client *http.Client) *GetEndpointsParams { + return &GetEndpointsParams{ + HTTPClient: client, + } +} + +/* GetEndpointsParams contains all the parameters to send to the API endpoint + for the get endpoints operation. + + Typically these are written to a http.Request. +*/ +type GetEndpointsParams struct { + + /* EndpointID. + + Telnexus Id of the endpoint to be retrieved + */ + EndpointID *string + + /* Limit. + + How many objects to return at one time (max 300, default 100) + + Format: int64 + Default: 100 + */ + Limit *int64 + + /* Offset. + + How many objects to skip? (default 0) + + Format: int64 + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get endpoints params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetEndpointsParams) WithDefaults() *GetEndpointsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get endpoints params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetEndpointsParams) SetDefaults() { + var ( + limitDefault = int64(100) + + offsetDefault = int64(0) + ) + + val := GetEndpointsParams{ + Limit: &limitDefault, + Offset: &offsetDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the get endpoints params +func (o *GetEndpointsParams) WithTimeout(timeout time.Duration) *GetEndpointsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get endpoints params +func (o *GetEndpointsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get endpoints params +func (o *GetEndpointsParams) WithContext(ctx context.Context) *GetEndpointsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get endpoints params +func (o *GetEndpointsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get endpoints params +func (o *GetEndpointsParams) WithHTTPClient(client *http.Client) *GetEndpointsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get endpoints params +func (o *GetEndpointsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEndpointID adds the endpointID to the get endpoints params +func (o *GetEndpointsParams) WithEndpointID(endpointID *string) *GetEndpointsParams { + o.SetEndpointID(endpointID) + return o +} + +// SetEndpointID adds the endpointId to the get endpoints params +func (o *GetEndpointsParams) SetEndpointID(endpointID *string) { + o.EndpointID = endpointID +} + +// WithLimit adds the limit to the get endpoints params +func (o *GetEndpointsParams) WithLimit(limit *int64) *GetEndpointsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get endpoints params +func (o *GetEndpointsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get endpoints params +func (o *GetEndpointsParams) WithOffset(offset *int64) *GetEndpointsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get endpoints params +func (o *GetEndpointsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetEndpointsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.EndpointID != nil { + + // query param endpointId + var qrEndpointID string + + if o.EndpointID != nil { + qrEndpointID = *o.EndpointID + } + qEndpointID := qrEndpointID + if qEndpointID != "" { + + if err := r.SetQueryParam("endpointId", qEndpointID); 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 +} diff --git a/api/voip/voip_client/endpoint/get_endpoints_responses.go b/api/voip/voip_client/endpoint/get_endpoints_responses.go new file mode 100644 index 0000000..efad779 --- /dev/null +++ b/api/voip/voip_client/endpoint/get_endpoints_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package endpoint + +// 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/telnexus/lib/api/voip/voip_models" +) + +// GetEndpointsReader is a Reader for the GetEndpoints structure. +type GetEndpointsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetEndpointsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetEndpointsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetEndpointsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetEndpointsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetEndpointsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetEndpointsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetEndpointsInternalServerError() + 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()) + } +} + +// NewGetEndpointsOK creates a GetEndpointsOK with default headers values +func NewGetEndpointsOK() *GetEndpointsOK { + return &GetEndpointsOK{} +} + +/* GetEndpointsOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of PBX objects +*/ +type GetEndpointsOK struct { + Payload *voip_models.EndpointResponse +} + +func (o *GetEndpointsOK) Error() string { + return fmt.Sprintf("[GET /endpoints][%d] getEndpointsOK %+v", 200, o.Payload) +} +func (o *GetEndpointsOK) GetPayload() *voip_models.EndpointResponse { + return o.Payload +} + +func (o *GetEndpointsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.EndpointResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetEndpointsUnauthorized creates a GetEndpointsUnauthorized with default headers values +func NewGetEndpointsUnauthorized() *GetEndpointsUnauthorized { + return &GetEndpointsUnauthorized{} +} + +/* GetEndpointsUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetEndpointsUnauthorized struct { + Payload *voip_models.Error +} + +func (o *GetEndpointsUnauthorized) Error() string { + return fmt.Sprintf("[GET /endpoints][%d] getEndpointsUnauthorized %+v", 401, o.Payload) +} +func (o *GetEndpointsUnauthorized) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetEndpointsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetEndpointsForbidden creates a GetEndpointsForbidden with default headers values +func NewGetEndpointsForbidden() *GetEndpointsForbidden { + return &GetEndpointsForbidden{} +} + +/* GetEndpointsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetEndpointsForbidden struct { + Payload *voip_models.Error +} + +func (o *GetEndpointsForbidden) Error() string { + return fmt.Sprintf("[GET /endpoints][%d] getEndpointsForbidden %+v", 403, o.Payload) +} +func (o *GetEndpointsForbidden) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetEndpointsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetEndpointsNotFound creates a GetEndpointsNotFound with default headers values +func NewGetEndpointsNotFound() *GetEndpointsNotFound { + return &GetEndpointsNotFound{} +} + +/* GetEndpointsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetEndpointsNotFound struct { + Payload *voip_models.Error +} + +func (o *GetEndpointsNotFound) Error() string { + return fmt.Sprintf("[GET /endpoints][%d] getEndpointsNotFound %+v", 404, o.Payload) +} +func (o *GetEndpointsNotFound) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetEndpointsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetEndpointsUnprocessableEntity creates a GetEndpointsUnprocessableEntity with default headers values +func NewGetEndpointsUnprocessableEntity() *GetEndpointsUnprocessableEntity { + return &GetEndpointsUnprocessableEntity{} +} + +/* GetEndpointsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetEndpointsUnprocessableEntity struct { + Payload *voip_models.Error +} + +func (o *GetEndpointsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /endpoints][%d] getEndpointsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetEndpointsUnprocessableEntity) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetEndpointsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetEndpointsInternalServerError creates a GetEndpointsInternalServerError with default headers values +func NewGetEndpointsInternalServerError() *GetEndpointsInternalServerError { + return &GetEndpointsInternalServerError{} +} + +/* GetEndpointsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetEndpointsInternalServerError struct { + Payload *voip_models.Error +} + +func (o *GetEndpointsInternalServerError) Error() string { + return fmt.Sprintf("[GET /endpoints][%d] getEndpointsInternalServerError %+v", 500, o.Payload) +} +func (o *GetEndpointsInternalServerError) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetEndpointsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/voip/voip_client/endpoint/post_endpoints_parameters.go b/api/voip/voip_client/endpoint/post_endpoints_parameters.go new file mode 100644 index 0000000..121b392 --- /dev/null +++ b/api/voip/voip_client/endpoint/post_endpoints_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package endpoint + +// 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/telnexus/lib/api/voip/voip_models" +) + +// NewPostEndpointsParams creates a new PostEndpointsParams 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 NewPostEndpointsParams() *PostEndpointsParams { + return &PostEndpointsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostEndpointsParamsWithTimeout creates a new PostEndpointsParams object +// with the ability to set a timeout on a request. +func NewPostEndpointsParamsWithTimeout(timeout time.Duration) *PostEndpointsParams { + return &PostEndpointsParams{ + timeout: timeout, + } +} + +// NewPostEndpointsParamsWithContext creates a new PostEndpointsParams object +// with the ability to set a context for a request. +func NewPostEndpointsParamsWithContext(ctx context.Context) *PostEndpointsParams { + return &PostEndpointsParams{ + Context: ctx, + } +} + +// NewPostEndpointsParamsWithHTTPClient creates a new PostEndpointsParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostEndpointsParamsWithHTTPClient(client *http.Client) *PostEndpointsParams { + return &PostEndpointsParams{ + HTTPClient: client, + } +} + +/* PostEndpointsParams contains all the parameters to send to the API endpoint + for the post endpoints operation. + + Typically these are written to a http.Request. +*/ +type PostEndpointsParams struct { + + /* EndpointRequest. + + An array of new PBX records + */ + EndpointRequest *voip_models.EndpointRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post endpoints params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostEndpointsParams) WithDefaults() *PostEndpointsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post endpoints params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostEndpointsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post endpoints params +func (o *PostEndpointsParams) WithTimeout(timeout time.Duration) *PostEndpointsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post endpoints params +func (o *PostEndpointsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post endpoints params +func (o *PostEndpointsParams) WithContext(ctx context.Context) *PostEndpointsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post endpoints params +func (o *PostEndpointsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post endpoints params +func (o *PostEndpointsParams) WithHTTPClient(client *http.Client) *PostEndpointsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post endpoints params +func (o *PostEndpointsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEndpointRequest adds the endpointRequest to the post endpoints params +func (o *PostEndpointsParams) WithEndpointRequest(endpointRequest *voip_models.EndpointRequest) *PostEndpointsParams { + o.SetEndpointRequest(endpointRequest) + return o +} + +// SetEndpointRequest adds the endpointRequest to the post endpoints params +func (o *PostEndpointsParams) SetEndpointRequest(endpointRequest *voip_models.EndpointRequest) { + o.EndpointRequest = endpointRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostEndpointsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.EndpointRequest != nil { + if err := r.SetBodyParam(o.EndpointRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/voip/voip_client/endpoint/post_endpoints_responses.go b/api/voip/voip_client/endpoint/post_endpoints_responses.go new file mode 100644 index 0000000..e137b6c --- /dev/null +++ b/api/voip/voip_client/endpoint/post_endpoints_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package endpoint + +// 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/telnexus/lib/api/voip/voip_models" +) + +// PostEndpointsReader is a Reader for the PostEndpoints structure. +type PostEndpointsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostEndpointsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostEndpointsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostEndpointsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostEndpointsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostEndpointsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostEndpointsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostEndpointsInternalServerError() + 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()) + } +} + +// NewPostEndpointsOK creates a PostEndpointsOK with default headers values +func NewPostEndpointsOK() *PostEndpointsOK { + return &PostEndpointsOK{} +} + +/* PostEndpointsOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of PBX objects +*/ +type PostEndpointsOK struct { + Payload *voip_models.EndpointResponse +} + +func (o *PostEndpointsOK) Error() string { + return fmt.Sprintf("[POST /endpoints][%d] postEndpointsOK %+v", 200, o.Payload) +} +func (o *PostEndpointsOK) GetPayload() *voip_models.EndpointResponse { + return o.Payload +} + +func (o *PostEndpointsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.EndpointResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostEndpointsUnauthorized creates a PostEndpointsUnauthorized with default headers values +func NewPostEndpointsUnauthorized() *PostEndpointsUnauthorized { + return &PostEndpointsUnauthorized{} +} + +/* PostEndpointsUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostEndpointsUnauthorized struct { + Payload *voip_models.Error +} + +func (o *PostEndpointsUnauthorized) Error() string { + return fmt.Sprintf("[POST /endpoints][%d] postEndpointsUnauthorized %+v", 401, o.Payload) +} +func (o *PostEndpointsUnauthorized) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostEndpointsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostEndpointsForbidden creates a PostEndpointsForbidden with default headers values +func NewPostEndpointsForbidden() *PostEndpointsForbidden { + return &PostEndpointsForbidden{} +} + +/* PostEndpointsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostEndpointsForbidden struct { + Payload *voip_models.Error +} + +func (o *PostEndpointsForbidden) Error() string { + return fmt.Sprintf("[POST /endpoints][%d] postEndpointsForbidden %+v", 403, o.Payload) +} +func (o *PostEndpointsForbidden) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostEndpointsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostEndpointsNotFound creates a PostEndpointsNotFound with default headers values +func NewPostEndpointsNotFound() *PostEndpointsNotFound { + return &PostEndpointsNotFound{} +} + +/* PostEndpointsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostEndpointsNotFound struct { + Payload *voip_models.Error +} + +func (o *PostEndpointsNotFound) Error() string { + return fmt.Sprintf("[POST /endpoints][%d] postEndpointsNotFound %+v", 404, o.Payload) +} +func (o *PostEndpointsNotFound) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostEndpointsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostEndpointsUnprocessableEntity creates a PostEndpointsUnprocessableEntity with default headers values +func NewPostEndpointsUnprocessableEntity() *PostEndpointsUnprocessableEntity { + return &PostEndpointsUnprocessableEntity{} +} + +/* PostEndpointsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostEndpointsUnprocessableEntity struct { + Payload *voip_models.Error +} + +func (o *PostEndpointsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /endpoints][%d] postEndpointsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PostEndpointsUnprocessableEntity) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostEndpointsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostEndpointsInternalServerError creates a PostEndpointsInternalServerError with default headers values +func NewPostEndpointsInternalServerError() *PostEndpointsInternalServerError { + return &PostEndpointsInternalServerError{} +} + +/* PostEndpointsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostEndpointsInternalServerError struct { + Payload *voip_models.Error +} + +func (o *PostEndpointsInternalServerError) Error() string { + return fmt.Sprintf("[POST /endpoints][%d] postEndpointsInternalServerError %+v", 500, o.Payload) +} +func (o *PostEndpointsInternalServerError) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostEndpointsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/voip/voip_client/endpoint/put_endpoints_parameters.go b/api/voip/voip_client/endpoint/put_endpoints_parameters.go new file mode 100644 index 0000000..6e82fc9 --- /dev/null +++ b/api/voip/voip_client/endpoint/put_endpoints_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package endpoint + +// 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/telnexus/lib/api/voip/voip_models" +) + +// NewPutEndpointsParams creates a new PutEndpointsParams 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 NewPutEndpointsParams() *PutEndpointsParams { + return &PutEndpointsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPutEndpointsParamsWithTimeout creates a new PutEndpointsParams object +// with the ability to set a timeout on a request. +func NewPutEndpointsParamsWithTimeout(timeout time.Duration) *PutEndpointsParams { + return &PutEndpointsParams{ + timeout: timeout, + } +} + +// NewPutEndpointsParamsWithContext creates a new PutEndpointsParams object +// with the ability to set a context for a request. +func NewPutEndpointsParamsWithContext(ctx context.Context) *PutEndpointsParams { + return &PutEndpointsParams{ + Context: ctx, + } +} + +// NewPutEndpointsParamsWithHTTPClient creates a new PutEndpointsParams object +// with the ability to set a custom HTTPClient for a request. +func NewPutEndpointsParamsWithHTTPClient(client *http.Client) *PutEndpointsParams { + return &PutEndpointsParams{ + HTTPClient: client, + } +} + +/* PutEndpointsParams contains all the parameters to send to the API endpoint + for the put endpoints operation. + + Typically these are written to a http.Request. +*/ +type PutEndpointsParams struct { + + /* EndpointRequest. + + An array of new PBX records + */ + EndpointRequest *voip_models.EndpointRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put endpoints params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutEndpointsParams) WithDefaults() *PutEndpointsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put endpoints params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutEndpointsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the put endpoints params +func (o *PutEndpointsParams) WithTimeout(timeout time.Duration) *PutEndpointsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put endpoints params +func (o *PutEndpointsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put endpoints params +func (o *PutEndpointsParams) WithContext(ctx context.Context) *PutEndpointsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put endpoints params +func (o *PutEndpointsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put endpoints params +func (o *PutEndpointsParams) WithHTTPClient(client *http.Client) *PutEndpointsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put endpoints params +func (o *PutEndpointsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEndpointRequest adds the endpointRequest to the put endpoints params +func (o *PutEndpointsParams) WithEndpointRequest(endpointRequest *voip_models.EndpointRequest) *PutEndpointsParams { + o.SetEndpointRequest(endpointRequest) + return o +} + +// SetEndpointRequest adds the endpointRequest to the put endpoints params +func (o *PutEndpointsParams) SetEndpointRequest(endpointRequest *voip_models.EndpointRequest) { + o.EndpointRequest = endpointRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutEndpointsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.EndpointRequest != nil { + if err := r.SetBodyParam(o.EndpointRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/voip/voip_client/endpoint/put_endpoints_responses.go b/api/voip/voip_client/endpoint/put_endpoints_responses.go new file mode 100644 index 0000000..a89bf26 --- /dev/null +++ b/api/voip/voip_client/endpoint/put_endpoints_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package endpoint + +// 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/telnexus/lib/api/voip/voip_models" +) + +// PutEndpointsReader is a Reader for the PutEndpoints structure. +type PutEndpointsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutEndpointsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutEndpointsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutEndpointsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutEndpointsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutEndpointsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutEndpointsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutEndpointsInternalServerError() + 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()) + } +} + +// NewPutEndpointsOK creates a PutEndpointsOK with default headers values +func NewPutEndpointsOK() *PutEndpointsOK { + return &PutEndpointsOK{} +} + +/* PutEndpointsOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of PBX objects +*/ +type PutEndpointsOK struct { + Payload *voip_models.EndpointResponse +} + +func (o *PutEndpointsOK) Error() string { + return fmt.Sprintf("[PUT /endpoints][%d] putEndpointsOK %+v", 200, o.Payload) +} +func (o *PutEndpointsOK) GetPayload() *voip_models.EndpointResponse { + return o.Payload +} + +func (o *PutEndpointsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.EndpointResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutEndpointsUnauthorized creates a PutEndpointsUnauthorized with default headers values +func NewPutEndpointsUnauthorized() *PutEndpointsUnauthorized { + return &PutEndpointsUnauthorized{} +} + +/* PutEndpointsUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutEndpointsUnauthorized struct { + Payload *voip_models.Error +} + +func (o *PutEndpointsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /endpoints][%d] putEndpointsUnauthorized %+v", 401, o.Payload) +} +func (o *PutEndpointsUnauthorized) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutEndpointsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutEndpointsForbidden creates a PutEndpointsForbidden with default headers values +func NewPutEndpointsForbidden() *PutEndpointsForbidden { + return &PutEndpointsForbidden{} +} + +/* PutEndpointsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PutEndpointsForbidden struct { + Payload *voip_models.Error +} + +func (o *PutEndpointsForbidden) Error() string { + return fmt.Sprintf("[PUT /endpoints][%d] putEndpointsForbidden %+v", 403, o.Payload) +} +func (o *PutEndpointsForbidden) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutEndpointsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutEndpointsNotFound creates a PutEndpointsNotFound with default headers values +func NewPutEndpointsNotFound() *PutEndpointsNotFound { + return &PutEndpointsNotFound{} +} + +/* PutEndpointsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PutEndpointsNotFound struct { + Payload *voip_models.Error +} + +func (o *PutEndpointsNotFound) Error() string { + return fmt.Sprintf("[PUT /endpoints][%d] putEndpointsNotFound %+v", 404, o.Payload) +} +func (o *PutEndpointsNotFound) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutEndpointsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutEndpointsUnprocessableEntity creates a PutEndpointsUnprocessableEntity with default headers values +func NewPutEndpointsUnprocessableEntity() *PutEndpointsUnprocessableEntity { + return &PutEndpointsUnprocessableEntity{} +} + +/* PutEndpointsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutEndpointsUnprocessableEntity struct { + Payload *voip_models.Error +} + +func (o *PutEndpointsUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /endpoints][%d] putEndpointsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PutEndpointsUnprocessableEntity) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutEndpointsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutEndpointsInternalServerError creates a PutEndpointsInternalServerError with default headers values +func NewPutEndpointsInternalServerError() *PutEndpointsInternalServerError { + return &PutEndpointsInternalServerError{} +} + +/* PutEndpointsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PutEndpointsInternalServerError struct { + Payload *voip_models.Error +} + +func (o *PutEndpointsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /endpoints][%d] putEndpointsInternalServerError %+v", 500, o.Payload) +} +func (o *PutEndpointsInternalServerError) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutEndpointsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/voip/voip_client/pbx/get_p_b_xes_parameters.go b/api/voip/voip_client/pbx/get_p_b_xes_parameters.go new file mode 100644 index 0000000..6acbcbf --- /dev/null +++ b/api/voip/voip_client/pbx/get_p_b_xes_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package pbx + +// 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" +) + +// NewGetPBXesParams creates a new GetPBXesParams 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 NewGetPBXesParams() *GetPBXesParams { + return &GetPBXesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetPBXesParamsWithTimeout creates a new GetPBXesParams object +// with the ability to set a timeout on a request. +func NewGetPBXesParamsWithTimeout(timeout time.Duration) *GetPBXesParams { + return &GetPBXesParams{ + timeout: timeout, + } +} + +// NewGetPBXesParamsWithContext creates a new GetPBXesParams object +// with the ability to set a context for a request. +func NewGetPBXesParamsWithContext(ctx context.Context) *GetPBXesParams { + return &GetPBXesParams{ + Context: ctx, + } +} + +// NewGetPBXesParamsWithHTTPClient creates a new GetPBXesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetPBXesParamsWithHTTPClient(client *http.Client) *GetPBXesParams { + return &GetPBXesParams{ + HTTPClient: client, + } +} + +/* GetPBXesParams contains all the parameters to send to the API endpoint + for the get p b xes operation. + + Typically these are written to a http.Request. +*/ +type GetPBXesParams struct { + + /* Limit. + + How many objects to return at one time (max 300, default 100) + + Format: int64 + Default: 100 + */ + Limit *int64 + + /* Offset. + + How many objects to skip? (default 0) + + Format: int64 + */ + Offset *int64 + + /* PbxID. + + Telnexus Id of the PBX to be retrieved + */ + PbxID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get p b xes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPBXesParams) WithDefaults() *GetPBXesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get p b xes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPBXesParams) SetDefaults() { + var ( + limitDefault = int64(100) + + offsetDefault = int64(0) + ) + + val := GetPBXesParams{ + Limit: &limitDefault, + Offset: &offsetDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the get p b xes params +func (o *GetPBXesParams) WithTimeout(timeout time.Duration) *GetPBXesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get p b xes params +func (o *GetPBXesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get p b xes params +func (o *GetPBXesParams) WithContext(ctx context.Context) *GetPBXesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get p b xes params +func (o *GetPBXesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get p b xes params +func (o *GetPBXesParams) WithHTTPClient(client *http.Client) *GetPBXesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get p b xes params +func (o *GetPBXesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the get p b xes params +func (o *GetPBXesParams) WithLimit(limit *int64) *GetPBXesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get p b xes params +func (o *GetPBXesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get p b xes params +func (o *GetPBXesParams) WithOffset(offset *int64) *GetPBXesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get p b xes params +func (o *GetPBXesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPbxID adds the pbxID to the get p b xes params +func (o *GetPBXesParams) WithPbxID(pbxID *string) *GetPBXesParams { + o.SetPbxID(pbxID) + return o +} + +// SetPbxID adds the pbxId to the get p b xes params +func (o *GetPBXesParams) SetPbxID(pbxID *string) { + o.PbxID = pbxID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPBXesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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 o.PbxID != nil { + + // query param pbxId + var qrPbxID string + + if o.PbxID != nil { + qrPbxID = *o.PbxID + } + qPbxID := qrPbxID + if qPbxID != "" { + + if err := r.SetQueryParam("pbxId", qPbxID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/voip/voip_client/pbx/get_p_b_xes_responses.go b/api/voip/voip_client/pbx/get_p_b_xes_responses.go new file mode 100644 index 0000000..92712af --- /dev/null +++ b/api/voip/voip_client/pbx/get_p_b_xes_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package pbx + +// 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/telnexus/lib/api/voip/voip_models" +) + +// GetPBXesReader is a Reader for the GetPBXes structure. +type GetPBXesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPBXesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPBXesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPBXesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetPBXesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPBXesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetPBXesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetPBXesInternalServerError() + 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()) + } +} + +// NewGetPBXesOK creates a GetPBXesOK with default headers values +func NewGetPBXesOK() *GetPBXesOK { + return &GetPBXesOK{} +} + +/* GetPBXesOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of PBX objects +*/ +type GetPBXesOK struct { + Payload *voip_models.PbxResponse +} + +func (o *GetPBXesOK) Error() string { + return fmt.Sprintf("[GET /pbxes][%d] getPBXesOK %+v", 200, o.Payload) +} +func (o *GetPBXesOK) GetPayload() *voip_models.PbxResponse { + return o.Payload +} + +func (o *GetPBXesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.PbxResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPBXesUnauthorized creates a GetPBXesUnauthorized with default headers values +func NewGetPBXesUnauthorized() *GetPBXesUnauthorized { + return &GetPBXesUnauthorized{} +} + +/* GetPBXesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetPBXesUnauthorized struct { + Payload *voip_models.Error +} + +func (o *GetPBXesUnauthorized) Error() string { + return fmt.Sprintf("[GET /pbxes][%d] getPBXesUnauthorized %+v", 401, o.Payload) +} +func (o *GetPBXesUnauthorized) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetPBXesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPBXesForbidden creates a GetPBXesForbidden with default headers values +func NewGetPBXesForbidden() *GetPBXesForbidden { + return &GetPBXesForbidden{} +} + +/* GetPBXesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetPBXesForbidden struct { + Payload *voip_models.Error +} + +func (o *GetPBXesForbidden) Error() string { + return fmt.Sprintf("[GET /pbxes][%d] getPBXesForbidden %+v", 403, o.Payload) +} +func (o *GetPBXesForbidden) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetPBXesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPBXesNotFound creates a GetPBXesNotFound with default headers values +func NewGetPBXesNotFound() *GetPBXesNotFound { + return &GetPBXesNotFound{} +} + +/* GetPBXesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetPBXesNotFound struct { + Payload *voip_models.Error +} + +func (o *GetPBXesNotFound) Error() string { + return fmt.Sprintf("[GET /pbxes][%d] getPBXesNotFound %+v", 404, o.Payload) +} +func (o *GetPBXesNotFound) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetPBXesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPBXesUnprocessableEntity creates a GetPBXesUnprocessableEntity with default headers values +func NewGetPBXesUnprocessableEntity() *GetPBXesUnprocessableEntity { + return &GetPBXesUnprocessableEntity{} +} + +/* GetPBXesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetPBXesUnprocessableEntity struct { + Payload *voip_models.Error +} + +func (o *GetPBXesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /pbxes][%d] getPBXesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetPBXesUnprocessableEntity) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetPBXesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPBXesInternalServerError creates a GetPBXesInternalServerError with default headers values +func NewGetPBXesInternalServerError() *GetPBXesInternalServerError { + return &GetPBXesInternalServerError{} +} + +/* GetPBXesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetPBXesInternalServerError struct { + Payload *voip_models.Error +} + +func (o *GetPBXesInternalServerError) Error() string { + return fmt.Sprintf("[GET /pbxes][%d] getPBXesInternalServerError %+v", 500, o.Payload) +} +func (o *GetPBXesInternalServerError) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetPBXesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/voip/voip_client/pbx/pbx_client.go b/api/voip/voip_client/pbx/pbx_client.go new file mode 100644 index 0000000..d994727 --- /dev/null +++ b/api/voip/voip_client/pbx/pbx_client.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package pbx + +// 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 pbx API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for pbx 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 { + GetPBXes(params *GetPBXesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPBXesOK, error) + + PostPBXes(params *PostPBXesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPBXesOK, error) + + PutPBXes(params *PutPBXesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPBXesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetPBXes gets a list of p b xes + + Return a list of available PBX entities +*/ +func (a *Client) GetPBXes(params *GetPBXesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPBXesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPBXesParams() + } + op := &runtime.ClientOperation{ + ID: "getPBXes", + Method: "GET", + PathPattern: "/pbxes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPBXesReader{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.(*GetPBXesOK) + 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 getPBXes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostPBXes adds new p b xes + + Create new PBXes +*/ +func (a *Client) PostPBXes(params *PostPBXesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPBXesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostPBXesParams() + } + op := &runtime.ClientOperation{ + ID: "postPBXes", + Method: "POST", + PathPattern: "/pbxes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostPBXesReader{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.(*PostPBXesOK) + 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 postPBXes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutPBXes updates p b xes + + Update fields in an PBX record identified by Telnexus Id +*/ +func (a *Client) PutPBXes(params *PutPBXesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPBXesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutPBXesParams() + } + op := &runtime.ClientOperation{ + ID: "putPBXes", + Method: "PUT", + PathPattern: "/pbxes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutPBXesReader{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.(*PutPBXesOK) + 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 putPBXes: 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 +} diff --git a/api/voip/voip_client/pbx/post_p_b_xes_parameters.go b/api/voip/voip_client/pbx/post_p_b_xes_parameters.go new file mode 100644 index 0000000..6e56726 --- /dev/null +++ b/api/voip/voip_client/pbx/post_p_b_xes_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package pbx + +// 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/telnexus/lib/api/voip/voip_models" +) + +// NewPostPBXesParams creates a new PostPBXesParams 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 NewPostPBXesParams() *PostPBXesParams { + return &PostPBXesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostPBXesParamsWithTimeout creates a new PostPBXesParams object +// with the ability to set a timeout on a request. +func NewPostPBXesParamsWithTimeout(timeout time.Duration) *PostPBXesParams { + return &PostPBXesParams{ + timeout: timeout, + } +} + +// NewPostPBXesParamsWithContext creates a new PostPBXesParams object +// with the ability to set a context for a request. +func NewPostPBXesParamsWithContext(ctx context.Context) *PostPBXesParams { + return &PostPBXesParams{ + Context: ctx, + } +} + +// NewPostPBXesParamsWithHTTPClient creates a new PostPBXesParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostPBXesParamsWithHTTPClient(client *http.Client) *PostPBXesParams { + return &PostPBXesParams{ + HTTPClient: client, + } +} + +/* PostPBXesParams contains all the parameters to send to the API endpoint + for the post p b xes operation. + + Typically these are written to a http.Request. +*/ +type PostPBXesParams struct { + + /* PbxRequest. + + An array of new PBX records + */ + PbxRequest *voip_models.PbxRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post p b xes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostPBXesParams) WithDefaults() *PostPBXesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post p b xes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostPBXesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post p b xes params +func (o *PostPBXesParams) WithTimeout(timeout time.Duration) *PostPBXesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post p b xes params +func (o *PostPBXesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post p b xes params +func (o *PostPBXesParams) WithContext(ctx context.Context) *PostPBXesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post p b xes params +func (o *PostPBXesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post p b xes params +func (o *PostPBXesParams) WithHTTPClient(client *http.Client) *PostPBXesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post p b xes params +func (o *PostPBXesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPbxRequest adds the pbxRequest to the post p b xes params +func (o *PostPBXesParams) WithPbxRequest(pbxRequest *voip_models.PbxRequest) *PostPBXesParams { + o.SetPbxRequest(pbxRequest) + return o +} + +// SetPbxRequest adds the pbxRequest to the post p b xes params +func (o *PostPBXesParams) SetPbxRequest(pbxRequest *voip_models.PbxRequest) { + o.PbxRequest = pbxRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostPBXesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.PbxRequest != nil { + if err := r.SetBodyParam(o.PbxRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/voip/voip_client/pbx/post_p_b_xes_responses.go b/api/voip/voip_client/pbx/post_p_b_xes_responses.go new file mode 100644 index 0000000..3a4b185 --- /dev/null +++ b/api/voip/voip_client/pbx/post_p_b_xes_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package pbx + +// 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/telnexus/lib/api/voip/voip_models" +) + +// PostPBXesReader is a Reader for the PostPBXes structure. +type PostPBXesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostPBXesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostPBXesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostPBXesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostPBXesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostPBXesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostPBXesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostPBXesInternalServerError() + 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()) + } +} + +// NewPostPBXesOK creates a PostPBXesOK with default headers values +func NewPostPBXesOK() *PostPBXesOK { + return &PostPBXesOK{} +} + +/* PostPBXesOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of PBX objects +*/ +type PostPBXesOK struct { + Payload *voip_models.PbxResponse +} + +func (o *PostPBXesOK) Error() string { + return fmt.Sprintf("[POST /pbxes][%d] postPBXesOK %+v", 200, o.Payload) +} +func (o *PostPBXesOK) GetPayload() *voip_models.PbxResponse { + return o.Payload +} + +func (o *PostPBXesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.PbxResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPBXesUnauthorized creates a PostPBXesUnauthorized with default headers values +func NewPostPBXesUnauthorized() *PostPBXesUnauthorized { + return &PostPBXesUnauthorized{} +} + +/* PostPBXesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostPBXesUnauthorized struct { + Payload *voip_models.Error +} + +func (o *PostPBXesUnauthorized) Error() string { + return fmt.Sprintf("[POST /pbxes][%d] postPBXesUnauthorized %+v", 401, o.Payload) +} +func (o *PostPBXesUnauthorized) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostPBXesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPBXesForbidden creates a PostPBXesForbidden with default headers values +func NewPostPBXesForbidden() *PostPBXesForbidden { + return &PostPBXesForbidden{} +} + +/* PostPBXesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostPBXesForbidden struct { + Payload *voip_models.Error +} + +func (o *PostPBXesForbidden) Error() string { + return fmt.Sprintf("[POST /pbxes][%d] postPBXesForbidden %+v", 403, o.Payload) +} +func (o *PostPBXesForbidden) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostPBXesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPBXesNotFound creates a PostPBXesNotFound with default headers values +func NewPostPBXesNotFound() *PostPBXesNotFound { + return &PostPBXesNotFound{} +} + +/* PostPBXesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostPBXesNotFound struct { + Payload *voip_models.Error +} + +func (o *PostPBXesNotFound) Error() string { + return fmt.Sprintf("[POST /pbxes][%d] postPBXesNotFound %+v", 404, o.Payload) +} +func (o *PostPBXesNotFound) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostPBXesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPBXesUnprocessableEntity creates a PostPBXesUnprocessableEntity with default headers values +func NewPostPBXesUnprocessableEntity() *PostPBXesUnprocessableEntity { + return &PostPBXesUnprocessableEntity{} +} + +/* PostPBXesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostPBXesUnprocessableEntity struct { + Payload *voip_models.Error +} + +func (o *PostPBXesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /pbxes][%d] postPBXesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PostPBXesUnprocessableEntity) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostPBXesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPBXesInternalServerError creates a PostPBXesInternalServerError with default headers values +func NewPostPBXesInternalServerError() *PostPBXesInternalServerError { + return &PostPBXesInternalServerError{} +} + +/* PostPBXesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostPBXesInternalServerError struct { + Payload *voip_models.Error +} + +func (o *PostPBXesInternalServerError) Error() string { + return fmt.Sprintf("[POST /pbxes][%d] postPBXesInternalServerError %+v", 500, o.Payload) +} +func (o *PostPBXesInternalServerError) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostPBXesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/voip/voip_client/pbx/put_p_b_xes_parameters.go b/api/voip/voip_client/pbx/put_p_b_xes_parameters.go new file mode 100644 index 0000000..1bc4793 --- /dev/null +++ b/api/voip/voip_client/pbx/put_p_b_xes_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package pbx + +// 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/telnexus/lib/api/voip/voip_models" +) + +// NewPutPBXesParams creates a new PutPBXesParams 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 NewPutPBXesParams() *PutPBXesParams { + return &PutPBXesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPutPBXesParamsWithTimeout creates a new PutPBXesParams object +// with the ability to set a timeout on a request. +func NewPutPBXesParamsWithTimeout(timeout time.Duration) *PutPBXesParams { + return &PutPBXesParams{ + timeout: timeout, + } +} + +// NewPutPBXesParamsWithContext creates a new PutPBXesParams object +// with the ability to set a context for a request. +func NewPutPBXesParamsWithContext(ctx context.Context) *PutPBXesParams { + return &PutPBXesParams{ + Context: ctx, + } +} + +// NewPutPBXesParamsWithHTTPClient creates a new PutPBXesParams object +// with the ability to set a custom HTTPClient for a request. +func NewPutPBXesParamsWithHTTPClient(client *http.Client) *PutPBXesParams { + return &PutPBXesParams{ + HTTPClient: client, + } +} + +/* PutPBXesParams contains all the parameters to send to the API endpoint + for the put p b xes operation. + + Typically these are written to a http.Request. +*/ +type PutPBXesParams struct { + + /* PbxRequest. + + An array of new PBX records + */ + PbxRequest *voip_models.PbxRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put p b xes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutPBXesParams) WithDefaults() *PutPBXesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put p b xes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutPBXesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the put p b xes params +func (o *PutPBXesParams) WithTimeout(timeout time.Duration) *PutPBXesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put p b xes params +func (o *PutPBXesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put p b xes params +func (o *PutPBXesParams) WithContext(ctx context.Context) *PutPBXesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put p b xes params +func (o *PutPBXesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put p b xes params +func (o *PutPBXesParams) WithHTTPClient(client *http.Client) *PutPBXesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put p b xes params +func (o *PutPBXesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPbxRequest adds the pbxRequest to the put p b xes params +func (o *PutPBXesParams) WithPbxRequest(pbxRequest *voip_models.PbxRequest) *PutPBXesParams { + o.SetPbxRequest(pbxRequest) + return o +} + +// SetPbxRequest adds the pbxRequest to the put p b xes params +func (o *PutPBXesParams) SetPbxRequest(pbxRequest *voip_models.PbxRequest) { + o.PbxRequest = pbxRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutPBXesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.PbxRequest != nil { + if err := r.SetBodyParam(o.PbxRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/voip/voip_client/pbx/put_p_b_xes_responses.go b/api/voip/voip_client/pbx/put_p_b_xes_responses.go new file mode 100644 index 0000000..2e9273b --- /dev/null +++ b/api/voip/voip_client/pbx/put_p_b_xes_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package pbx + +// 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/telnexus/lib/api/voip/voip_models" +) + +// PutPBXesReader is a Reader for the PutPBXes structure. +type PutPBXesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutPBXesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutPBXesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutPBXesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutPBXesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutPBXesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutPBXesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutPBXesInternalServerError() + 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()) + } +} + +// NewPutPBXesOK creates a PutPBXesOK with default headers values +func NewPutPBXesOK() *PutPBXesOK { + return &PutPBXesOK{} +} + +/* PutPBXesOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of PBX objects +*/ +type PutPBXesOK struct { + Payload *voip_models.PbxResponse +} + +func (o *PutPBXesOK) Error() string { + return fmt.Sprintf("[PUT /pbxes][%d] putPBXesOK %+v", 200, o.Payload) +} +func (o *PutPBXesOK) GetPayload() *voip_models.PbxResponse { + return o.Payload +} + +func (o *PutPBXesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.PbxResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPBXesUnauthorized creates a PutPBXesUnauthorized with default headers values +func NewPutPBXesUnauthorized() *PutPBXesUnauthorized { + return &PutPBXesUnauthorized{} +} + +/* PutPBXesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutPBXesUnauthorized struct { + Payload *voip_models.Error +} + +func (o *PutPBXesUnauthorized) Error() string { + return fmt.Sprintf("[PUT /pbxes][%d] putPBXesUnauthorized %+v", 401, o.Payload) +} +func (o *PutPBXesUnauthorized) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutPBXesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPBXesForbidden creates a PutPBXesForbidden with default headers values +func NewPutPBXesForbidden() *PutPBXesForbidden { + return &PutPBXesForbidden{} +} + +/* PutPBXesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PutPBXesForbidden struct { + Payload *voip_models.Error +} + +func (o *PutPBXesForbidden) Error() string { + return fmt.Sprintf("[PUT /pbxes][%d] putPBXesForbidden %+v", 403, o.Payload) +} +func (o *PutPBXesForbidden) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutPBXesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPBXesNotFound creates a PutPBXesNotFound with default headers values +func NewPutPBXesNotFound() *PutPBXesNotFound { + return &PutPBXesNotFound{} +} + +/* PutPBXesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PutPBXesNotFound struct { + Payload *voip_models.Error +} + +func (o *PutPBXesNotFound) Error() string { + return fmt.Sprintf("[PUT /pbxes][%d] putPBXesNotFound %+v", 404, o.Payload) +} +func (o *PutPBXesNotFound) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutPBXesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPBXesUnprocessableEntity creates a PutPBXesUnprocessableEntity with default headers values +func NewPutPBXesUnprocessableEntity() *PutPBXesUnprocessableEntity { + return &PutPBXesUnprocessableEntity{} +} + +/* PutPBXesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutPBXesUnprocessableEntity struct { + Payload *voip_models.Error +} + +func (o *PutPBXesUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /pbxes][%d] putPBXesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PutPBXesUnprocessableEntity) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutPBXesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPBXesInternalServerError creates a PutPBXesInternalServerError with default headers values +func NewPutPBXesInternalServerError() *PutPBXesInternalServerError { + return &PutPBXesInternalServerError{} +} + +/* PutPBXesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PutPBXesInternalServerError struct { + Payload *voip_models.Error +} + +func (o *PutPBXesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /pbxes][%d] putPBXesInternalServerError %+v", 500, o.Payload) +} +func (o *PutPBXesInternalServerError) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutPBXesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/voip/voip_client/pbx_user/get_p_b_x_users_parameters.go b/api/voip/voip_client/pbx_user/get_p_b_x_users_parameters.go new file mode 100644 index 0000000..c3fb936 --- /dev/null +++ b/api/voip/voip_client/pbx_user/get_p_b_x_users_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package pbx_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" + "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" +) + +// NewGetPBXUsersParams creates a new GetPBXUsersParams 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 NewGetPBXUsersParams() *GetPBXUsersParams { + return &GetPBXUsersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetPBXUsersParamsWithTimeout creates a new GetPBXUsersParams object +// with the ability to set a timeout on a request. +func NewGetPBXUsersParamsWithTimeout(timeout time.Duration) *GetPBXUsersParams { + return &GetPBXUsersParams{ + timeout: timeout, + } +} + +// NewGetPBXUsersParamsWithContext creates a new GetPBXUsersParams object +// with the ability to set a context for a request. +func NewGetPBXUsersParamsWithContext(ctx context.Context) *GetPBXUsersParams { + return &GetPBXUsersParams{ + Context: ctx, + } +} + +// NewGetPBXUsersParamsWithHTTPClient creates a new GetPBXUsersParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetPBXUsersParamsWithHTTPClient(client *http.Client) *GetPBXUsersParams { + return &GetPBXUsersParams{ + HTTPClient: client, + } +} + +/* GetPBXUsersParams contains all the parameters to send to the API endpoint + for the get p b x users operation. + + Typically these are written to a http.Request. +*/ +type GetPBXUsersParams struct { + + /* Limit. + + How many objects to return at one time (max 300, default 100) + + Format: int64 + Default: 100 + */ + Limit *int64 + + /* Offset. + + How many objects to skip? (default 0) + + Format: int64 + */ + Offset *int64 + + /* PbxUserID. + + Telnexus Id of the PBX User to be retrieved + */ + PbxUserID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get p b x users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPBXUsersParams) WithDefaults() *GetPBXUsersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get p b x users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPBXUsersParams) SetDefaults() { + var ( + limitDefault = int64(100) + + offsetDefault = int64(0) + ) + + val := GetPBXUsersParams{ + Limit: &limitDefault, + Offset: &offsetDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the get p b x users params +func (o *GetPBXUsersParams) WithTimeout(timeout time.Duration) *GetPBXUsersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get p b x users params +func (o *GetPBXUsersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get p b x users params +func (o *GetPBXUsersParams) WithContext(ctx context.Context) *GetPBXUsersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get p b x users params +func (o *GetPBXUsersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get p b x users params +func (o *GetPBXUsersParams) WithHTTPClient(client *http.Client) *GetPBXUsersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get p b x users params +func (o *GetPBXUsersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the get p b x users params +func (o *GetPBXUsersParams) WithLimit(limit *int64) *GetPBXUsersParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get p b x users params +func (o *GetPBXUsersParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get p b x users params +func (o *GetPBXUsersParams) WithOffset(offset *int64) *GetPBXUsersParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get p b x users params +func (o *GetPBXUsersParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPbxUserID adds the pbxUserID to the get p b x users params +func (o *GetPBXUsersParams) WithPbxUserID(pbxUserID *string) *GetPBXUsersParams { + o.SetPbxUserID(pbxUserID) + return o +} + +// SetPbxUserID adds the pbxUserId to the get p b x users params +func (o *GetPBXUsersParams) SetPbxUserID(pbxUserID *string) { + o.PbxUserID = pbxUserID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPBXUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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 o.PbxUserID != nil { + + // query param pbxUserId + var qrPbxUserID string + + if o.PbxUserID != nil { + qrPbxUserID = *o.PbxUserID + } + qPbxUserID := qrPbxUserID + if qPbxUserID != "" { + + if err := r.SetQueryParam("pbxUserId", qPbxUserID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/voip/voip_client/pbx_user/get_p_b_x_users_responses.go b/api/voip/voip_client/pbx_user/get_p_b_x_users_responses.go new file mode 100644 index 0000000..af5f51c --- /dev/null +++ b/api/voip/voip_client/pbx_user/get_p_b_x_users_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package pbx_user + +// 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/telnexus/lib/api/voip/voip_models" +) + +// GetPBXUsersReader is a Reader for the GetPBXUsers structure. +type GetPBXUsersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPBXUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPBXUsersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPBXUsersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetPBXUsersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPBXUsersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetPBXUsersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetPBXUsersInternalServerError() + 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()) + } +} + +// NewGetPBXUsersOK creates a GetPBXUsersOK with default headers values +func NewGetPBXUsersOK() *GetPBXUsersOK { + return &GetPBXUsersOK{} +} + +/* GetPBXUsersOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of PBX User objects +*/ +type GetPBXUsersOK struct { + Payload *voip_models.PbxUserResponse +} + +func (o *GetPBXUsersOK) Error() string { + return fmt.Sprintf("[GET /pbxusers][%d] getPBXUsersOK %+v", 200, o.Payload) +} +func (o *GetPBXUsersOK) GetPayload() *voip_models.PbxUserResponse { + return o.Payload +} + +func (o *GetPBXUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.PbxUserResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPBXUsersUnauthorized creates a GetPBXUsersUnauthorized with default headers values +func NewGetPBXUsersUnauthorized() *GetPBXUsersUnauthorized { + return &GetPBXUsersUnauthorized{} +} + +/* GetPBXUsersUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetPBXUsersUnauthorized struct { + Payload *voip_models.Error +} + +func (o *GetPBXUsersUnauthorized) Error() string { + return fmt.Sprintf("[GET /pbxusers][%d] getPBXUsersUnauthorized %+v", 401, o.Payload) +} +func (o *GetPBXUsersUnauthorized) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetPBXUsersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPBXUsersForbidden creates a GetPBXUsersForbidden with default headers values +func NewGetPBXUsersForbidden() *GetPBXUsersForbidden { + return &GetPBXUsersForbidden{} +} + +/* GetPBXUsersForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetPBXUsersForbidden struct { + Payload *voip_models.Error +} + +func (o *GetPBXUsersForbidden) Error() string { + return fmt.Sprintf("[GET /pbxusers][%d] getPBXUsersForbidden %+v", 403, o.Payload) +} +func (o *GetPBXUsersForbidden) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetPBXUsersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPBXUsersNotFound creates a GetPBXUsersNotFound with default headers values +func NewGetPBXUsersNotFound() *GetPBXUsersNotFound { + return &GetPBXUsersNotFound{} +} + +/* GetPBXUsersNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetPBXUsersNotFound struct { + Payload *voip_models.Error +} + +func (o *GetPBXUsersNotFound) Error() string { + return fmt.Sprintf("[GET /pbxusers][%d] getPBXUsersNotFound %+v", 404, o.Payload) +} +func (o *GetPBXUsersNotFound) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetPBXUsersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPBXUsersUnprocessableEntity creates a GetPBXUsersUnprocessableEntity with default headers values +func NewGetPBXUsersUnprocessableEntity() *GetPBXUsersUnprocessableEntity { + return &GetPBXUsersUnprocessableEntity{} +} + +/* GetPBXUsersUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetPBXUsersUnprocessableEntity struct { + Payload *voip_models.Error +} + +func (o *GetPBXUsersUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /pbxusers][%d] getPBXUsersUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetPBXUsersUnprocessableEntity) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetPBXUsersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPBXUsersInternalServerError creates a GetPBXUsersInternalServerError with default headers values +func NewGetPBXUsersInternalServerError() *GetPBXUsersInternalServerError { + return &GetPBXUsersInternalServerError{} +} + +/* GetPBXUsersInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetPBXUsersInternalServerError struct { + Payload *voip_models.Error +} + +func (o *GetPBXUsersInternalServerError) Error() string { + return fmt.Sprintf("[GET /pbxusers][%d] getPBXUsersInternalServerError %+v", 500, o.Payload) +} +func (o *GetPBXUsersInternalServerError) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetPBXUsersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/voip/voip_client/pbx_user/p_b_x_users_parameters.go b/api/voip/voip_client/pbx_user/p_b_x_users_parameters.go new file mode 100644 index 0000000..7b22bc4 --- /dev/null +++ b/api/voip/voip_client/pbx_user/p_b_x_users_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package pbx_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" + "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/telnexus/lib/api/voip/voip_models" +) + +// NewPBXUsersParams creates a new PBXUsersParams 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 NewPBXUsersParams() *PBXUsersParams { + return &PBXUsersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPBXUsersParamsWithTimeout creates a new PBXUsersParams object +// with the ability to set a timeout on a request. +func NewPBXUsersParamsWithTimeout(timeout time.Duration) *PBXUsersParams { + return &PBXUsersParams{ + timeout: timeout, + } +} + +// NewPBXUsersParamsWithContext creates a new PBXUsersParams object +// with the ability to set a context for a request. +func NewPBXUsersParamsWithContext(ctx context.Context) *PBXUsersParams { + return &PBXUsersParams{ + Context: ctx, + } +} + +// NewPBXUsersParamsWithHTTPClient creates a new PBXUsersParams object +// with the ability to set a custom HTTPClient for a request. +func NewPBXUsersParamsWithHTTPClient(client *http.Client) *PBXUsersParams { + return &PBXUsersParams{ + HTTPClient: client, + } +} + +/* PBXUsersParams contains all the parameters to send to the API endpoint + for the p b x users operation. + + Typically these are written to a http.Request. +*/ +type PBXUsersParams struct { + + /* PbxUserRequest. + + An array of new PBX User records + */ + PbxUserRequest *voip_models.PbxUserRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the p b x users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PBXUsersParams) WithDefaults() *PBXUsersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the p b x users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PBXUsersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the p b x users params +func (o *PBXUsersParams) WithTimeout(timeout time.Duration) *PBXUsersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the p b x users params +func (o *PBXUsersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the p b x users params +func (o *PBXUsersParams) WithContext(ctx context.Context) *PBXUsersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the p b x users params +func (o *PBXUsersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the p b x users params +func (o *PBXUsersParams) WithHTTPClient(client *http.Client) *PBXUsersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the p b x users params +func (o *PBXUsersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPbxUserRequest adds the pbxUserRequest to the p b x users params +func (o *PBXUsersParams) WithPbxUserRequest(pbxUserRequest *voip_models.PbxUserRequest) *PBXUsersParams { + o.SetPbxUserRequest(pbxUserRequest) + return o +} + +// SetPbxUserRequest adds the pbxUserRequest to the p b x users params +func (o *PBXUsersParams) SetPbxUserRequest(pbxUserRequest *voip_models.PbxUserRequest) { + o.PbxUserRequest = pbxUserRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PBXUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.PbxUserRequest != nil { + if err := r.SetBodyParam(o.PbxUserRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/voip/voip_client/pbx_user/p_b_x_users_responses.go b/api/voip/voip_client/pbx_user/p_b_x_users_responses.go new file mode 100644 index 0000000..067c5dd --- /dev/null +++ b/api/voip/voip_client/pbx_user/p_b_x_users_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package pbx_user + +// 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/telnexus/lib/api/voip/voip_models" +) + +// PBXUsersReader is a Reader for the PBXUsers structure. +type PBXUsersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PBXUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPBXUsersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPBXUsersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPBXUsersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPBXUsersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPBXUsersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPBXUsersInternalServerError() + 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()) + } +} + +// NewPBXUsersOK creates a PBXUsersOK with default headers values +func NewPBXUsersOK() *PBXUsersOK { + return &PBXUsersOK{} +} + +/* PBXUsersOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of PBX User objects +*/ +type PBXUsersOK struct { + Payload *voip_models.PbxUserResponse +} + +func (o *PBXUsersOK) Error() string { + return fmt.Sprintf("[PUT /pbxusers][%d] pBXUsersOK %+v", 200, o.Payload) +} +func (o *PBXUsersOK) GetPayload() *voip_models.PbxUserResponse { + return o.Payload +} + +func (o *PBXUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.PbxUserResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPBXUsersUnauthorized creates a PBXUsersUnauthorized with default headers values +func NewPBXUsersUnauthorized() *PBXUsersUnauthorized { + return &PBXUsersUnauthorized{} +} + +/* PBXUsersUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PBXUsersUnauthorized struct { + Payload *voip_models.Error +} + +func (o *PBXUsersUnauthorized) Error() string { + return fmt.Sprintf("[PUT /pbxusers][%d] pBXUsersUnauthorized %+v", 401, o.Payload) +} +func (o *PBXUsersUnauthorized) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PBXUsersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPBXUsersForbidden creates a PBXUsersForbidden with default headers values +func NewPBXUsersForbidden() *PBXUsersForbidden { + return &PBXUsersForbidden{} +} + +/* PBXUsersForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PBXUsersForbidden struct { + Payload *voip_models.Error +} + +func (o *PBXUsersForbidden) Error() string { + return fmt.Sprintf("[PUT /pbxusers][%d] pBXUsersForbidden %+v", 403, o.Payload) +} +func (o *PBXUsersForbidden) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PBXUsersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPBXUsersNotFound creates a PBXUsersNotFound with default headers values +func NewPBXUsersNotFound() *PBXUsersNotFound { + return &PBXUsersNotFound{} +} + +/* PBXUsersNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PBXUsersNotFound struct { + Payload *voip_models.Error +} + +func (o *PBXUsersNotFound) Error() string { + return fmt.Sprintf("[PUT /pbxusers][%d] pBXUsersNotFound %+v", 404, o.Payload) +} +func (o *PBXUsersNotFound) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PBXUsersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPBXUsersUnprocessableEntity creates a PBXUsersUnprocessableEntity with default headers values +func NewPBXUsersUnprocessableEntity() *PBXUsersUnprocessableEntity { + return &PBXUsersUnprocessableEntity{} +} + +/* PBXUsersUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PBXUsersUnprocessableEntity struct { + Payload *voip_models.Error +} + +func (o *PBXUsersUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /pbxusers][%d] pBXUsersUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PBXUsersUnprocessableEntity) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PBXUsersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPBXUsersInternalServerError creates a PBXUsersInternalServerError with default headers values +func NewPBXUsersInternalServerError() *PBXUsersInternalServerError { + return &PBXUsersInternalServerError{} +} + +/* PBXUsersInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PBXUsersInternalServerError struct { + Payload *voip_models.Error +} + +func (o *PBXUsersInternalServerError) Error() string { + return fmt.Sprintf("[PUT /pbxusers][%d] pBXUsersInternalServerError %+v", 500, o.Payload) +} +func (o *PBXUsersInternalServerError) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PBXUsersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/voip/voip_client/pbx_user/pbx_user_client.go b/api/voip/voip_client/pbx_user/pbx_user_client.go new file mode 100644 index 0000000..0137dc9 --- /dev/null +++ b/api/voip/voip_client/pbx_user/pbx_user_client.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package pbx_user + +// 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 pbx user API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for pbx user 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 { + PBXUsers(params *PBXUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PBXUsersOK, error) + + GetPBXUsers(params *GetPBXUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPBXUsersOK, error) + + PostPBXUsers(params *PostPBXUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPBXUsersOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + PBXUsers updates p b x users + + Update fields in PBXUsers record identified by Telnexus Id +*/ +func (a *Client) PBXUsers(params *PBXUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PBXUsersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPBXUsersParams() + } + op := &runtime.ClientOperation{ + ID: "PBXUsers", + Method: "PUT", + PathPattern: "/pbxusers", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PBXUsersReader{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.(*PBXUsersOK) + 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 PBXUsers: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetPBXUsers gets a list of authorities + + Return a list of available PBX Users +*/ +func (a *Client) GetPBXUsers(params *GetPBXUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPBXUsersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPBXUsersParams() + } + op := &runtime.ClientOperation{ + ID: "getPBXUsers", + Method: "GET", + PathPattern: "/pbxusers", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPBXUsersReader{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.(*GetPBXUsersOK) + 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 getPBXUsers: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostPBXUsers adds new p b x users + + Create new PBXUsers +*/ +func (a *Client) PostPBXUsers(params *PostPBXUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPBXUsersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostPBXUsersParams() + } + op := &runtime.ClientOperation{ + ID: "postPBXUsers", + Method: "POST", + PathPattern: "/pbxusers", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostPBXUsersReader{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.(*PostPBXUsersOK) + 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 postPBXUsers: 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 +} diff --git a/api/voip/voip_client/pbx_user/post_p_b_x_users_parameters.go b/api/voip/voip_client/pbx_user/post_p_b_x_users_parameters.go new file mode 100644 index 0000000..f0dd481 --- /dev/null +++ b/api/voip/voip_client/pbx_user/post_p_b_x_users_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package pbx_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" + "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/telnexus/lib/api/voip/voip_models" +) + +// NewPostPBXUsersParams creates a new PostPBXUsersParams 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 NewPostPBXUsersParams() *PostPBXUsersParams { + return &PostPBXUsersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostPBXUsersParamsWithTimeout creates a new PostPBXUsersParams object +// with the ability to set a timeout on a request. +func NewPostPBXUsersParamsWithTimeout(timeout time.Duration) *PostPBXUsersParams { + return &PostPBXUsersParams{ + timeout: timeout, + } +} + +// NewPostPBXUsersParamsWithContext creates a new PostPBXUsersParams object +// with the ability to set a context for a request. +func NewPostPBXUsersParamsWithContext(ctx context.Context) *PostPBXUsersParams { + return &PostPBXUsersParams{ + Context: ctx, + } +} + +// NewPostPBXUsersParamsWithHTTPClient creates a new PostPBXUsersParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostPBXUsersParamsWithHTTPClient(client *http.Client) *PostPBXUsersParams { + return &PostPBXUsersParams{ + HTTPClient: client, + } +} + +/* PostPBXUsersParams contains all the parameters to send to the API endpoint + for the post p b x users operation. + + Typically these are written to a http.Request. +*/ +type PostPBXUsersParams struct { + + /* PbxUserRequest. + + An array of new PBX User records + */ + PbxUserRequest *voip_models.PbxUserRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post p b x users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostPBXUsersParams) WithDefaults() *PostPBXUsersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post p b x users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostPBXUsersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post p b x users params +func (o *PostPBXUsersParams) WithTimeout(timeout time.Duration) *PostPBXUsersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post p b x users params +func (o *PostPBXUsersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post p b x users params +func (o *PostPBXUsersParams) WithContext(ctx context.Context) *PostPBXUsersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post p b x users params +func (o *PostPBXUsersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post p b x users params +func (o *PostPBXUsersParams) WithHTTPClient(client *http.Client) *PostPBXUsersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post p b x users params +func (o *PostPBXUsersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPbxUserRequest adds the pbxUserRequest to the post p b x users params +func (o *PostPBXUsersParams) WithPbxUserRequest(pbxUserRequest *voip_models.PbxUserRequest) *PostPBXUsersParams { + o.SetPbxUserRequest(pbxUserRequest) + return o +} + +// SetPbxUserRequest adds the pbxUserRequest to the post p b x users params +func (o *PostPBXUsersParams) SetPbxUserRequest(pbxUserRequest *voip_models.PbxUserRequest) { + o.PbxUserRequest = pbxUserRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostPBXUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.PbxUserRequest != nil { + if err := r.SetBodyParam(o.PbxUserRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/voip/voip_client/pbx_user/post_p_b_x_users_responses.go b/api/voip/voip_client/pbx_user/post_p_b_x_users_responses.go new file mode 100644 index 0000000..1ac5688 --- /dev/null +++ b/api/voip/voip_client/pbx_user/post_p_b_x_users_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package pbx_user + +// 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/telnexus/lib/api/voip/voip_models" +) + +// PostPBXUsersReader is a Reader for the PostPBXUsers structure. +type PostPBXUsersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostPBXUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostPBXUsersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostPBXUsersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostPBXUsersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostPBXUsersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostPBXUsersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostPBXUsersInternalServerError() + 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()) + } +} + +// NewPostPBXUsersOK creates a PostPBXUsersOK with default headers values +func NewPostPBXUsersOK() *PostPBXUsersOK { + return &PostPBXUsersOK{} +} + +/* PostPBXUsersOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of PBX User objects +*/ +type PostPBXUsersOK struct { + Payload *voip_models.PbxUserResponse +} + +func (o *PostPBXUsersOK) Error() string { + return fmt.Sprintf("[POST /pbxusers][%d] postPBXUsersOK %+v", 200, o.Payload) +} +func (o *PostPBXUsersOK) GetPayload() *voip_models.PbxUserResponse { + return o.Payload +} + +func (o *PostPBXUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.PbxUserResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPBXUsersUnauthorized creates a PostPBXUsersUnauthorized with default headers values +func NewPostPBXUsersUnauthorized() *PostPBXUsersUnauthorized { + return &PostPBXUsersUnauthorized{} +} + +/* PostPBXUsersUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostPBXUsersUnauthorized struct { + Payload *voip_models.Error +} + +func (o *PostPBXUsersUnauthorized) Error() string { + return fmt.Sprintf("[POST /pbxusers][%d] postPBXUsersUnauthorized %+v", 401, o.Payload) +} +func (o *PostPBXUsersUnauthorized) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostPBXUsersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPBXUsersForbidden creates a PostPBXUsersForbidden with default headers values +func NewPostPBXUsersForbidden() *PostPBXUsersForbidden { + return &PostPBXUsersForbidden{} +} + +/* PostPBXUsersForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostPBXUsersForbidden struct { + Payload *voip_models.Error +} + +func (o *PostPBXUsersForbidden) Error() string { + return fmt.Sprintf("[POST /pbxusers][%d] postPBXUsersForbidden %+v", 403, o.Payload) +} +func (o *PostPBXUsersForbidden) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostPBXUsersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPBXUsersNotFound creates a PostPBXUsersNotFound with default headers values +func NewPostPBXUsersNotFound() *PostPBXUsersNotFound { + return &PostPBXUsersNotFound{} +} + +/* PostPBXUsersNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostPBXUsersNotFound struct { + Payload *voip_models.Error +} + +func (o *PostPBXUsersNotFound) Error() string { + return fmt.Sprintf("[POST /pbxusers][%d] postPBXUsersNotFound %+v", 404, o.Payload) +} +func (o *PostPBXUsersNotFound) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostPBXUsersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPBXUsersUnprocessableEntity creates a PostPBXUsersUnprocessableEntity with default headers values +func NewPostPBXUsersUnprocessableEntity() *PostPBXUsersUnprocessableEntity { + return &PostPBXUsersUnprocessableEntity{} +} + +/* PostPBXUsersUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostPBXUsersUnprocessableEntity struct { + Payload *voip_models.Error +} + +func (o *PostPBXUsersUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /pbxusers][%d] postPBXUsersUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PostPBXUsersUnprocessableEntity) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostPBXUsersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPBXUsersInternalServerError creates a PostPBXUsersInternalServerError with default headers values +func NewPostPBXUsersInternalServerError() *PostPBXUsersInternalServerError { + return &PostPBXUsersInternalServerError{} +} + +/* PostPBXUsersInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostPBXUsersInternalServerError struct { + Payload *voip_models.Error +} + +func (o *PostPBXUsersInternalServerError) Error() string { + return fmt.Sprintf("[POST /pbxusers][%d] postPBXUsersInternalServerError %+v", 500, o.Payload) +} +func (o *PostPBXUsersInternalServerError) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostPBXUsersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/voip/voip_client/phone_number/get_phone_numbers_parameters.go b/api/voip/voip_client/phone_number/get_phone_numbers_parameters.go new file mode 100644 index 0000000..5d65943 --- /dev/null +++ b/api/voip/voip_client/phone_number/get_phone_numbers_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package phone_number + +// 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" +) + +// NewGetPhoneNumbersParams creates a new GetPhoneNumbersParams 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 NewGetPhoneNumbersParams() *GetPhoneNumbersParams { + return &GetPhoneNumbersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetPhoneNumbersParamsWithTimeout creates a new GetPhoneNumbersParams object +// with the ability to set a timeout on a request. +func NewGetPhoneNumbersParamsWithTimeout(timeout time.Duration) *GetPhoneNumbersParams { + return &GetPhoneNumbersParams{ + timeout: timeout, + } +} + +// NewGetPhoneNumbersParamsWithContext creates a new GetPhoneNumbersParams object +// with the ability to set a context for a request. +func NewGetPhoneNumbersParamsWithContext(ctx context.Context) *GetPhoneNumbersParams { + return &GetPhoneNumbersParams{ + Context: ctx, + } +} + +// NewGetPhoneNumbersParamsWithHTTPClient creates a new GetPhoneNumbersParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetPhoneNumbersParamsWithHTTPClient(client *http.Client) *GetPhoneNumbersParams { + return &GetPhoneNumbersParams{ + HTTPClient: client, + } +} + +/* GetPhoneNumbersParams contains all the parameters to send to the API endpoint + for the get phone numbers operation. + + Typically these are written to a http.Request. +*/ +type GetPhoneNumbersParams struct { + + /* Limit. + + How many objects to return at one time (max 300, default 100) + + Format: int64 + Default: 100 + */ + Limit *int64 + + /* Offset. + + How many objects to skip? (default 0) + + Format: int64 + */ + Offset *int64 + + /* PhoneNumberID. + + Telnexus Id of the Phone Number to be retrieved + */ + PhoneNumberID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get phone numbers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPhoneNumbersParams) WithDefaults() *GetPhoneNumbersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get phone numbers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPhoneNumbersParams) SetDefaults() { + var ( + limitDefault = int64(100) + + offsetDefault = int64(0) + ) + + val := GetPhoneNumbersParams{ + Limit: &limitDefault, + Offset: &offsetDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the get phone numbers params +func (o *GetPhoneNumbersParams) WithTimeout(timeout time.Duration) *GetPhoneNumbersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get phone numbers params +func (o *GetPhoneNumbersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get phone numbers params +func (o *GetPhoneNumbersParams) WithContext(ctx context.Context) *GetPhoneNumbersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get phone numbers params +func (o *GetPhoneNumbersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get phone numbers params +func (o *GetPhoneNumbersParams) WithHTTPClient(client *http.Client) *GetPhoneNumbersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get phone numbers params +func (o *GetPhoneNumbersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the get phone numbers params +func (o *GetPhoneNumbersParams) WithLimit(limit *int64) *GetPhoneNumbersParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get phone numbers params +func (o *GetPhoneNumbersParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get phone numbers params +func (o *GetPhoneNumbersParams) WithOffset(offset *int64) *GetPhoneNumbersParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get phone numbers params +func (o *GetPhoneNumbersParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPhoneNumberID adds the phoneNumberID to the get phone numbers params +func (o *GetPhoneNumbersParams) WithPhoneNumberID(phoneNumberID *string) *GetPhoneNumbersParams { + o.SetPhoneNumberID(phoneNumberID) + return o +} + +// SetPhoneNumberID adds the phoneNumberId to the get phone numbers params +func (o *GetPhoneNumbersParams) SetPhoneNumberID(phoneNumberID *string) { + o.PhoneNumberID = phoneNumberID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPhoneNumbersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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 o.PhoneNumberID != nil { + + // query param phoneNumberId + var qrPhoneNumberID string + + if o.PhoneNumberID != nil { + qrPhoneNumberID = *o.PhoneNumberID + } + qPhoneNumberID := qrPhoneNumberID + if qPhoneNumberID != "" { + + if err := r.SetQueryParam("phoneNumberId", qPhoneNumberID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/voip/voip_client/phone_number/get_phone_numbers_responses.go b/api/voip/voip_client/phone_number/get_phone_numbers_responses.go new file mode 100644 index 0000000..35851e4 --- /dev/null +++ b/api/voip/voip_client/phone_number/get_phone_numbers_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package phone_number + +// 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/telnexus/lib/api/voip/voip_models" +) + +// GetPhoneNumbersReader is a Reader for the GetPhoneNumbers structure. +type GetPhoneNumbersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPhoneNumbersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPhoneNumbersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPhoneNumbersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetPhoneNumbersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPhoneNumbersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetPhoneNumbersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetPhoneNumbersInternalServerError() + 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()) + } +} + +// NewGetPhoneNumbersOK creates a GetPhoneNumbersOK with default headers values +func NewGetPhoneNumbersOK() *GetPhoneNumbersOK { + return &GetPhoneNumbersOK{} +} + +/* GetPhoneNumbersOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of PBX objects +*/ +type GetPhoneNumbersOK struct { + Payload *voip_models.PhoneNumberResponse +} + +func (o *GetPhoneNumbersOK) Error() string { + return fmt.Sprintf("[GET /phonenumbers][%d] getPhoneNumbersOK %+v", 200, o.Payload) +} +func (o *GetPhoneNumbersOK) GetPayload() *voip_models.PhoneNumberResponse { + return o.Payload +} + +func (o *GetPhoneNumbersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.PhoneNumberResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPhoneNumbersUnauthorized creates a GetPhoneNumbersUnauthorized with default headers values +func NewGetPhoneNumbersUnauthorized() *GetPhoneNumbersUnauthorized { + return &GetPhoneNumbersUnauthorized{} +} + +/* GetPhoneNumbersUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetPhoneNumbersUnauthorized struct { + Payload *voip_models.Error +} + +func (o *GetPhoneNumbersUnauthorized) Error() string { + return fmt.Sprintf("[GET /phonenumbers][%d] getPhoneNumbersUnauthorized %+v", 401, o.Payload) +} +func (o *GetPhoneNumbersUnauthorized) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetPhoneNumbersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPhoneNumbersForbidden creates a GetPhoneNumbersForbidden with default headers values +func NewGetPhoneNumbersForbidden() *GetPhoneNumbersForbidden { + return &GetPhoneNumbersForbidden{} +} + +/* GetPhoneNumbersForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetPhoneNumbersForbidden struct { + Payload *voip_models.Error +} + +func (o *GetPhoneNumbersForbidden) Error() string { + return fmt.Sprintf("[GET /phonenumbers][%d] getPhoneNumbersForbidden %+v", 403, o.Payload) +} +func (o *GetPhoneNumbersForbidden) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetPhoneNumbersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPhoneNumbersNotFound creates a GetPhoneNumbersNotFound with default headers values +func NewGetPhoneNumbersNotFound() *GetPhoneNumbersNotFound { + return &GetPhoneNumbersNotFound{} +} + +/* GetPhoneNumbersNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetPhoneNumbersNotFound struct { + Payload *voip_models.Error +} + +func (o *GetPhoneNumbersNotFound) Error() string { + return fmt.Sprintf("[GET /phonenumbers][%d] getPhoneNumbersNotFound %+v", 404, o.Payload) +} +func (o *GetPhoneNumbersNotFound) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetPhoneNumbersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPhoneNumbersUnprocessableEntity creates a GetPhoneNumbersUnprocessableEntity with default headers values +func NewGetPhoneNumbersUnprocessableEntity() *GetPhoneNumbersUnprocessableEntity { + return &GetPhoneNumbersUnprocessableEntity{} +} + +/* GetPhoneNumbersUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetPhoneNumbersUnprocessableEntity struct { + Payload *voip_models.Error +} + +func (o *GetPhoneNumbersUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /phonenumbers][%d] getPhoneNumbersUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetPhoneNumbersUnprocessableEntity) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetPhoneNumbersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPhoneNumbersInternalServerError creates a GetPhoneNumbersInternalServerError with default headers values +func NewGetPhoneNumbersInternalServerError() *GetPhoneNumbersInternalServerError { + return &GetPhoneNumbersInternalServerError{} +} + +/* GetPhoneNumbersInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetPhoneNumbersInternalServerError struct { + Payload *voip_models.Error +} + +func (o *GetPhoneNumbersInternalServerError) Error() string { + return fmt.Sprintf("[GET /phonenumbers][%d] getPhoneNumbersInternalServerError %+v", 500, o.Payload) +} +func (o *GetPhoneNumbersInternalServerError) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetPhoneNumbersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/voip/voip_client/phone_number/phone_number_client.go b/api/voip/voip_client/phone_number/phone_number_client.go new file mode 100644 index 0000000..894270f --- /dev/null +++ b/api/voip/voip_client/phone_number/phone_number_client.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package phone_number + +// 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 phone number API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for phone number 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 { + GetPhoneNumbers(params *GetPhoneNumbersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPhoneNumbersOK, error) + + PostPhoneNumbers(params *PostPhoneNumbersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPhoneNumbersOK, error) + + PutPhoneNumbers(params *PutPhoneNumbersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPhoneNumbersOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetPhoneNumbers gets a list of phone number + + Return a list of available Phone Number entities +*/ +func (a *Client) GetPhoneNumbers(params *GetPhoneNumbersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPhoneNumbersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPhoneNumbersParams() + } + op := &runtime.ClientOperation{ + ID: "getPhoneNumbers", + Method: "GET", + PathPattern: "/phonenumbers", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPhoneNumbersReader{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.(*GetPhoneNumbersOK) + 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 getPhoneNumbers: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostPhoneNumbers adds new phone numbers + + Create new Phone Numbers +*/ +func (a *Client) PostPhoneNumbers(params *PostPhoneNumbersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostPhoneNumbersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostPhoneNumbersParams() + } + op := &runtime.ClientOperation{ + ID: "postPhoneNumbers", + Method: "POST", + PathPattern: "/phonenumbers", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostPhoneNumbersReader{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.(*PostPhoneNumbersOK) + 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 postPhoneNumbers: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutPhoneNumbers updates phone numbers + + Update fields in an Phone Number record identified by Telnexus Id +*/ +func (a *Client) PutPhoneNumbers(params *PutPhoneNumbersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutPhoneNumbersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutPhoneNumbersParams() + } + op := &runtime.ClientOperation{ + ID: "putPhoneNumbers", + Method: "PUT", + PathPattern: "/phonenumbers", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutPhoneNumbersReader{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.(*PutPhoneNumbersOK) + 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 putPhoneNumbers: 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 +} diff --git a/api/voip/voip_client/phone_number/post_phone_numbers_parameters.go b/api/voip/voip_client/phone_number/post_phone_numbers_parameters.go new file mode 100644 index 0000000..277ac9c --- /dev/null +++ b/api/voip/voip_client/phone_number/post_phone_numbers_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package phone_number + +// 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/telnexus/lib/api/voip/voip_models" +) + +// NewPostPhoneNumbersParams creates a new PostPhoneNumbersParams 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 NewPostPhoneNumbersParams() *PostPhoneNumbersParams { + return &PostPhoneNumbersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostPhoneNumbersParamsWithTimeout creates a new PostPhoneNumbersParams object +// with the ability to set a timeout on a request. +func NewPostPhoneNumbersParamsWithTimeout(timeout time.Duration) *PostPhoneNumbersParams { + return &PostPhoneNumbersParams{ + timeout: timeout, + } +} + +// NewPostPhoneNumbersParamsWithContext creates a new PostPhoneNumbersParams object +// with the ability to set a context for a request. +func NewPostPhoneNumbersParamsWithContext(ctx context.Context) *PostPhoneNumbersParams { + return &PostPhoneNumbersParams{ + Context: ctx, + } +} + +// NewPostPhoneNumbersParamsWithHTTPClient creates a new PostPhoneNumbersParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostPhoneNumbersParamsWithHTTPClient(client *http.Client) *PostPhoneNumbersParams { + return &PostPhoneNumbersParams{ + HTTPClient: client, + } +} + +/* PostPhoneNumbersParams contains all the parameters to send to the API endpoint + for the post phone numbers operation. + + Typically these are written to a http.Request. +*/ +type PostPhoneNumbersParams struct { + + /* PhoneNumberRequest. + + An array of new PBX records + */ + PhoneNumberRequest *voip_models.PhoneNumberRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post phone numbers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostPhoneNumbersParams) WithDefaults() *PostPhoneNumbersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post phone numbers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostPhoneNumbersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post phone numbers params +func (o *PostPhoneNumbersParams) WithTimeout(timeout time.Duration) *PostPhoneNumbersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post phone numbers params +func (o *PostPhoneNumbersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post phone numbers params +func (o *PostPhoneNumbersParams) WithContext(ctx context.Context) *PostPhoneNumbersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post phone numbers params +func (o *PostPhoneNumbersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post phone numbers params +func (o *PostPhoneNumbersParams) WithHTTPClient(client *http.Client) *PostPhoneNumbersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post phone numbers params +func (o *PostPhoneNumbersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPhoneNumberRequest adds the phoneNumberRequest to the post phone numbers params +func (o *PostPhoneNumbersParams) WithPhoneNumberRequest(phoneNumberRequest *voip_models.PhoneNumberRequest) *PostPhoneNumbersParams { + o.SetPhoneNumberRequest(phoneNumberRequest) + return o +} + +// SetPhoneNumberRequest adds the phoneNumberRequest to the post phone numbers params +func (o *PostPhoneNumbersParams) SetPhoneNumberRequest(phoneNumberRequest *voip_models.PhoneNumberRequest) { + o.PhoneNumberRequest = phoneNumberRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostPhoneNumbersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.PhoneNumberRequest != nil { + if err := r.SetBodyParam(o.PhoneNumberRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/voip/voip_client/phone_number/post_phone_numbers_responses.go b/api/voip/voip_client/phone_number/post_phone_numbers_responses.go new file mode 100644 index 0000000..ad30704 --- /dev/null +++ b/api/voip/voip_client/phone_number/post_phone_numbers_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package phone_number + +// 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/telnexus/lib/api/voip/voip_models" +) + +// PostPhoneNumbersReader is a Reader for the PostPhoneNumbers structure. +type PostPhoneNumbersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostPhoneNumbersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostPhoneNumbersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostPhoneNumbersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostPhoneNumbersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostPhoneNumbersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostPhoneNumbersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostPhoneNumbersInternalServerError() + 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()) + } +} + +// NewPostPhoneNumbersOK creates a PostPhoneNumbersOK with default headers values +func NewPostPhoneNumbersOK() *PostPhoneNumbersOK { + return &PostPhoneNumbersOK{} +} + +/* PostPhoneNumbersOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of PBX objects +*/ +type PostPhoneNumbersOK struct { + Payload *voip_models.PhoneNumberResponse +} + +func (o *PostPhoneNumbersOK) Error() string { + return fmt.Sprintf("[POST /phonenumbers][%d] postPhoneNumbersOK %+v", 200, o.Payload) +} +func (o *PostPhoneNumbersOK) GetPayload() *voip_models.PhoneNumberResponse { + return o.Payload +} + +func (o *PostPhoneNumbersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.PhoneNumberResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPhoneNumbersUnauthorized creates a PostPhoneNumbersUnauthorized with default headers values +func NewPostPhoneNumbersUnauthorized() *PostPhoneNumbersUnauthorized { + return &PostPhoneNumbersUnauthorized{} +} + +/* PostPhoneNumbersUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostPhoneNumbersUnauthorized struct { + Payload *voip_models.Error +} + +func (o *PostPhoneNumbersUnauthorized) Error() string { + return fmt.Sprintf("[POST /phonenumbers][%d] postPhoneNumbersUnauthorized %+v", 401, o.Payload) +} +func (o *PostPhoneNumbersUnauthorized) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostPhoneNumbersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPhoneNumbersForbidden creates a PostPhoneNumbersForbidden with default headers values +func NewPostPhoneNumbersForbidden() *PostPhoneNumbersForbidden { + return &PostPhoneNumbersForbidden{} +} + +/* PostPhoneNumbersForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostPhoneNumbersForbidden struct { + Payload *voip_models.Error +} + +func (o *PostPhoneNumbersForbidden) Error() string { + return fmt.Sprintf("[POST /phonenumbers][%d] postPhoneNumbersForbidden %+v", 403, o.Payload) +} +func (o *PostPhoneNumbersForbidden) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostPhoneNumbersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPhoneNumbersNotFound creates a PostPhoneNumbersNotFound with default headers values +func NewPostPhoneNumbersNotFound() *PostPhoneNumbersNotFound { + return &PostPhoneNumbersNotFound{} +} + +/* PostPhoneNumbersNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostPhoneNumbersNotFound struct { + Payload *voip_models.Error +} + +func (o *PostPhoneNumbersNotFound) Error() string { + return fmt.Sprintf("[POST /phonenumbers][%d] postPhoneNumbersNotFound %+v", 404, o.Payload) +} +func (o *PostPhoneNumbersNotFound) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostPhoneNumbersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPhoneNumbersUnprocessableEntity creates a PostPhoneNumbersUnprocessableEntity with default headers values +func NewPostPhoneNumbersUnprocessableEntity() *PostPhoneNumbersUnprocessableEntity { + return &PostPhoneNumbersUnprocessableEntity{} +} + +/* PostPhoneNumbersUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostPhoneNumbersUnprocessableEntity struct { + Payload *voip_models.Error +} + +func (o *PostPhoneNumbersUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /phonenumbers][%d] postPhoneNumbersUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PostPhoneNumbersUnprocessableEntity) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostPhoneNumbersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPhoneNumbersInternalServerError creates a PostPhoneNumbersInternalServerError with default headers values +func NewPostPhoneNumbersInternalServerError() *PostPhoneNumbersInternalServerError { + return &PostPhoneNumbersInternalServerError{} +} + +/* PostPhoneNumbersInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostPhoneNumbersInternalServerError struct { + Payload *voip_models.Error +} + +func (o *PostPhoneNumbersInternalServerError) Error() string { + return fmt.Sprintf("[POST /phonenumbers][%d] postPhoneNumbersInternalServerError %+v", 500, o.Payload) +} +func (o *PostPhoneNumbersInternalServerError) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostPhoneNumbersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/voip/voip_client/phone_number/put_phone_numbers_parameters.go b/api/voip/voip_client/phone_number/put_phone_numbers_parameters.go new file mode 100644 index 0000000..145eed5 --- /dev/null +++ b/api/voip/voip_client/phone_number/put_phone_numbers_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package phone_number + +// 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/telnexus/lib/api/voip/voip_models" +) + +// NewPutPhoneNumbersParams creates a new PutPhoneNumbersParams 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 NewPutPhoneNumbersParams() *PutPhoneNumbersParams { + return &PutPhoneNumbersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPutPhoneNumbersParamsWithTimeout creates a new PutPhoneNumbersParams object +// with the ability to set a timeout on a request. +func NewPutPhoneNumbersParamsWithTimeout(timeout time.Duration) *PutPhoneNumbersParams { + return &PutPhoneNumbersParams{ + timeout: timeout, + } +} + +// NewPutPhoneNumbersParamsWithContext creates a new PutPhoneNumbersParams object +// with the ability to set a context for a request. +func NewPutPhoneNumbersParamsWithContext(ctx context.Context) *PutPhoneNumbersParams { + return &PutPhoneNumbersParams{ + Context: ctx, + } +} + +// NewPutPhoneNumbersParamsWithHTTPClient creates a new PutPhoneNumbersParams object +// with the ability to set a custom HTTPClient for a request. +func NewPutPhoneNumbersParamsWithHTTPClient(client *http.Client) *PutPhoneNumbersParams { + return &PutPhoneNumbersParams{ + HTTPClient: client, + } +} + +/* PutPhoneNumbersParams contains all the parameters to send to the API endpoint + for the put phone numbers operation. + + Typically these are written to a http.Request. +*/ +type PutPhoneNumbersParams struct { + + /* PhoneNumberRequest. + + An array of new PBX records + */ + PhoneNumberRequest *voip_models.PhoneNumberRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put phone numbers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutPhoneNumbersParams) WithDefaults() *PutPhoneNumbersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put phone numbers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutPhoneNumbersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the put phone numbers params +func (o *PutPhoneNumbersParams) WithTimeout(timeout time.Duration) *PutPhoneNumbersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put phone numbers params +func (o *PutPhoneNumbersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put phone numbers params +func (o *PutPhoneNumbersParams) WithContext(ctx context.Context) *PutPhoneNumbersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put phone numbers params +func (o *PutPhoneNumbersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put phone numbers params +func (o *PutPhoneNumbersParams) WithHTTPClient(client *http.Client) *PutPhoneNumbersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put phone numbers params +func (o *PutPhoneNumbersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPhoneNumberRequest adds the phoneNumberRequest to the put phone numbers params +func (o *PutPhoneNumbersParams) WithPhoneNumberRequest(phoneNumberRequest *voip_models.PhoneNumberRequest) *PutPhoneNumbersParams { + o.SetPhoneNumberRequest(phoneNumberRequest) + return o +} + +// SetPhoneNumberRequest adds the phoneNumberRequest to the put phone numbers params +func (o *PutPhoneNumbersParams) SetPhoneNumberRequest(phoneNumberRequest *voip_models.PhoneNumberRequest) { + o.PhoneNumberRequest = phoneNumberRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutPhoneNumbersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.PhoneNumberRequest != nil { + if err := r.SetBodyParam(o.PhoneNumberRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/voip/voip_client/phone_number/put_phone_numbers_responses.go b/api/voip/voip_client/phone_number/put_phone_numbers_responses.go new file mode 100644 index 0000000..8803a61 --- /dev/null +++ b/api/voip/voip_client/phone_number/put_phone_numbers_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package phone_number + +// 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/telnexus/lib/api/voip/voip_models" +) + +// PutPhoneNumbersReader is a Reader for the PutPhoneNumbers structure. +type PutPhoneNumbersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutPhoneNumbersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutPhoneNumbersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutPhoneNumbersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutPhoneNumbersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutPhoneNumbersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutPhoneNumbersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutPhoneNumbersInternalServerError() + 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()) + } +} + +// NewPutPhoneNumbersOK creates a PutPhoneNumbersOK with default headers values +func NewPutPhoneNumbersOK() *PutPhoneNumbersOK { + return &PutPhoneNumbersOK{} +} + +/* PutPhoneNumbersOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of PBX objects +*/ +type PutPhoneNumbersOK struct { + Payload *voip_models.PhoneNumberResponse +} + +func (o *PutPhoneNumbersOK) Error() string { + return fmt.Sprintf("[PUT /phonenumbers][%d] putPhoneNumbersOK %+v", 200, o.Payload) +} +func (o *PutPhoneNumbersOK) GetPayload() *voip_models.PhoneNumberResponse { + return o.Payload +} + +func (o *PutPhoneNumbersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.PhoneNumberResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPhoneNumbersUnauthorized creates a PutPhoneNumbersUnauthorized with default headers values +func NewPutPhoneNumbersUnauthorized() *PutPhoneNumbersUnauthorized { + return &PutPhoneNumbersUnauthorized{} +} + +/* PutPhoneNumbersUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutPhoneNumbersUnauthorized struct { + Payload *voip_models.Error +} + +func (o *PutPhoneNumbersUnauthorized) Error() string { + return fmt.Sprintf("[PUT /phonenumbers][%d] putPhoneNumbersUnauthorized %+v", 401, o.Payload) +} +func (o *PutPhoneNumbersUnauthorized) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutPhoneNumbersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPhoneNumbersForbidden creates a PutPhoneNumbersForbidden with default headers values +func NewPutPhoneNumbersForbidden() *PutPhoneNumbersForbidden { + return &PutPhoneNumbersForbidden{} +} + +/* PutPhoneNumbersForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PutPhoneNumbersForbidden struct { + Payload *voip_models.Error +} + +func (o *PutPhoneNumbersForbidden) Error() string { + return fmt.Sprintf("[PUT /phonenumbers][%d] putPhoneNumbersForbidden %+v", 403, o.Payload) +} +func (o *PutPhoneNumbersForbidden) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutPhoneNumbersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPhoneNumbersNotFound creates a PutPhoneNumbersNotFound with default headers values +func NewPutPhoneNumbersNotFound() *PutPhoneNumbersNotFound { + return &PutPhoneNumbersNotFound{} +} + +/* PutPhoneNumbersNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PutPhoneNumbersNotFound struct { + Payload *voip_models.Error +} + +func (o *PutPhoneNumbersNotFound) Error() string { + return fmt.Sprintf("[PUT /phonenumbers][%d] putPhoneNumbersNotFound %+v", 404, o.Payload) +} +func (o *PutPhoneNumbersNotFound) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutPhoneNumbersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPhoneNumbersUnprocessableEntity creates a PutPhoneNumbersUnprocessableEntity with default headers values +func NewPutPhoneNumbersUnprocessableEntity() *PutPhoneNumbersUnprocessableEntity { + return &PutPhoneNumbersUnprocessableEntity{} +} + +/* PutPhoneNumbersUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutPhoneNumbersUnprocessableEntity struct { + Payload *voip_models.Error +} + +func (o *PutPhoneNumbersUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /phonenumbers][%d] putPhoneNumbersUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PutPhoneNumbersUnprocessableEntity) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutPhoneNumbersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPhoneNumbersInternalServerError creates a PutPhoneNumbersInternalServerError with default headers values +func NewPutPhoneNumbersInternalServerError() *PutPhoneNumbersInternalServerError { + return &PutPhoneNumbersInternalServerError{} +} + +/* PutPhoneNumbersInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PutPhoneNumbersInternalServerError struct { + Payload *voip_models.Error +} + +func (o *PutPhoneNumbersInternalServerError) Error() string { + return fmt.Sprintf("[PUT /phonenumbers][%d] putPhoneNumbersInternalServerError %+v", 500, o.Payload) +} +func (o *PutPhoneNumbersInternalServerError) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutPhoneNumbersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/voip/voip_client/queue/get_queues_parameters.go b/api/voip/voip_client/queue/get_queues_parameters.go new file mode 100644 index 0000000..63b7e2e --- /dev/null +++ b/api/voip/voip_client/queue/get_queues_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package queue + +// 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" +) + +// NewGetQueuesParams creates a new GetQueuesParams 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 NewGetQueuesParams() *GetQueuesParams { + return &GetQueuesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetQueuesParamsWithTimeout creates a new GetQueuesParams object +// with the ability to set a timeout on a request. +func NewGetQueuesParamsWithTimeout(timeout time.Duration) *GetQueuesParams { + return &GetQueuesParams{ + timeout: timeout, + } +} + +// NewGetQueuesParamsWithContext creates a new GetQueuesParams object +// with the ability to set a context for a request. +func NewGetQueuesParamsWithContext(ctx context.Context) *GetQueuesParams { + return &GetQueuesParams{ + Context: ctx, + } +} + +// NewGetQueuesParamsWithHTTPClient creates a new GetQueuesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetQueuesParamsWithHTTPClient(client *http.Client) *GetQueuesParams { + return &GetQueuesParams{ + HTTPClient: client, + } +} + +/* GetQueuesParams contains all the parameters to send to the API endpoint + for the get queues operation. + + Typically these are written to a http.Request. +*/ +type GetQueuesParams struct { + + /* Limit. + + How many objects to return at one time (max 300, default 100) + + Format: int64 + Default: 100 + */ + Limit *int64 + + /* Offset. + + How many objects to skip? (default 0) + + Format: int64 + */ + Offset *int64 + + /* QueueID. + + Telnexus Id of the Queue to be retrieved + */ + QueueID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get queues params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetQueuesParams) WithDefaults() *GetQueuesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get queues params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetQueuesParams) SetDefaults() { + var ( + limitDefault = int64(100) + + offsetDefault = int64(0) + ) + + val := GetQueuesParams{ + Limit: &limitDefault, + Offset: &offsetDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the get queues params +func (o *GetQueuesParams) WithTimeout(timeout time.Duration) *GetQueuesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get queues params +func (o *GetQueuesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get queues params +func (o *GetQueuesParams) WithContext(ctx context.Context) *GetQueuesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get queues params +func (o *GetQueuesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get queues params +func (o *GetQueuesParams) WithHTTPClient(client *http.Client) *GetQueuesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get queues params +func (o *GetQueuesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the get queues params +func (o *GetQueuesParams) WithLimit(limit *int64) *GetQueuesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get queues params +func (o *GetQueuesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get queues params +func (o *GetQueuesParams) WithOffset(offset *int64) *GetQueuesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get queues params +func (o *GetQueuesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQueueID adds the queueID to the get queues params +func (o *GetQueuesParams) WithQueueID(queueID *string) *GetQueuesParams { + o.SetQueueID(queueID) + return o +} + +// SetQueueID adds the queueId to the get queues params +func (o *GetQueuesParams) SetQueueID(queueID *string) { + o.QueueID = queueID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetQueuesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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 o.QueueID != nil { + + // query param queueId + var qrQueueID string + + if o.QueueID != nil { + qrQueueID = *o.QueueID + } + qQueueID := qrQueueID + if qQueueID != "" { + + if err := r.SetQueryParam("queueId", qQueueID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/voip/voip_client/queue/get_queues_responses.go b/api/voip/voip_client/queue/get_queues_responses.go new file mode 100644 index 0000000..292e6b2 --- /dev/null +++ b/api/voip/voip_client/queue/get_queues_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package queue + +// 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/telnexus/lib/api/voip/voip_models" +) + +// GetQueuesReader is a Reader for the GetQueues structure. +type GetQueuesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetQueuesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetQueuesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetQueuesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetQueuesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetQueuesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetQueuesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetQueuesInternalServerError() + 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()) + } +} + +// NewGetQueuesOK creates a GetQueuesOK with default headers values +func NewGetQueuesOK() *GetQueuesOK { + return &GetQueuesOK{} +} + +/* GetQueuesOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of Queue objects +*/ +type GetQueuesOK struct { + Payload *voip_models.QueueResponse +} + +func (o *GetQueuesOK) Error() string { + return fmt.Sprintf("[GET /queues][%d] getQueuesOK %+v", 200, o.Payload) +} +func (o *GetQueuesOK) GetPayload() *voip_models.QueueResponse { + return o.Payload +} + +func (o *GetQueuesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.QueueResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetQueuesUnauthorized creates a GetQueuesUnauthorized with default headers values +func NewGetQueuesUnauthorized() *GetQueuesUnauthorized { + return &GetQueuesUnauthorized{} +} + +/* GetQueuesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetQueuesUnauthorized struct { + Payload *voip_models.Error +} + +func (o *GetQueuesUnauthorized) Error() string { + return fmt.Sprintf("[GET /queues][%d] getQueuesUnauthorized %+v", 401, o.Payload) +} +func (o *GetQueuesUnauthorized) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetQueuesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetQueuesForbidden creates a GetQueuesForbidden with default headers values +func NewGetQueuesForbidden() *GetQueuesForbidden { + return &GetQueuesForbidden{} +} + +/* GetQueuesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetQueuesForbidden struct { + Payload *voip_models.Error +} + +func (o *GetQueuesForbidden) Error() string { + return fmt.Sprintf("[GET /queues][%d] getQueuesForbidden %+v", 403, o.Payload) +} +func (o *GetQueuesForbidden) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetQueuesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetQueuesNotFound creates a GetQueuesNotFound with default headers values +func NewGetQueuesNotFound() *GetQueuesNotFound { + return &GetQueuesNotFound{} +} + +/* GetQueuesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetQueuesNotFound struct { + Payload *voip_models.Error +} + +func (o *GetQueuesNotFound) Error() string { + return fmt.Sprintf("[GET /queues][%d] getQueuesNotFound %+v", 404, o.Payload) +} +func (o *GetQueuesNotFound) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetQueuesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetQueuesUnprocessableEntity creates a GetQueuesUnprocessableEntity with default headers values +func NewGetQueuesUnprocessableEntity() *GetQueuesUnprocessableEntity { + return &GetQueuesUnprocessableEntity{} +} + +/* GetQueuesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetQueuesUnprocessableEntity struct { + Payload *voip_models.Error +} + +func (o *GetQueuesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /queues][%d] getQueuesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetQueuesUnprocessableEntity) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetQueuesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetQueuesInternalServerError creates a GetQueuesInternalServerError with default headers values +func NewGetQueuesInternalServerError() *GetQueuesInternalServerError { + return &GetQueuesInternalServerError{} +} + +/* GetQueuesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetQueuesInternalServerError struct { + Payload *voip_models.Error +} + +func (o *GetQueuesInternalServerError) Error() string { + return fmt.Sprintf("[GET /queues][%d] getQueuesInternalServerError %+v", 500, o.Payload) +} +func (o *GetQueuesInternalServerError) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetQueuesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/voip/voip_client/queue/post_queues_parameters.go b/api/voip/voip_client/queue/post_queues_parameters.go new file mode 100644 index 0000000..0e8bc9c --- /dev/null +++ b/api/voip/voip_client/queue/post_queues_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package queue + +// 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/telnexus/lib/api/voip/voip_models" +) + +// NewPostQueuesParams creates a new PostQueuesParams 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 NewPostQueuesParams() *PostQueuesParams { + return &PostQueuesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostQueuesParamsWithTimeout creates a new PostQueuesParams object +// with the ability to set a timeout on a request. +func NewPostQueuesParamsWithTimeout(timeout time.Duration) *PostQueuesParams { + return &PostQueuesParams{ + timeout: timeout, + } +} + +// NewPostQueuesParamsWithContext creates a new PostQueuesParams object +// with the ability to set a context for a request. +func NewPostQueuesParamsWithContext(ctx context.Context) *PostQueuesParams { + return &PostQueuesParams{ + Context: ctx, + } +} + +// NewPostQueuesParamsWithHTTPClient creates a new PostQueuesParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostQueuesParamsWithHTTPClient(client *http.Client) *PostQueuesParams { + return &PostQueuesParams{ + HTTPClient: client, + } +} + +/* PostQueuesParams contains all the parameters to send to the API endpoint + for the post queues operation. + + Typically these are written to a http.Request. +*/ +type PostQueuesParams struct { + + /* QueueRequest. + + An array of new Queues + */ + QueueRequest *voip_models.QueueRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post queues params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostQueuesParams) WithDefaults() *PostQueuesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post queues params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostQueuesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post queues params +func (o *PostQueuesParams) WithTimeout(timeout time.Duration) *PostQueuesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post queues params +func (o *PostQueuesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post queues params +func (o *PostQueuesParams) WithContext(ctx context.Context) *PostQueuesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post queues params +func (o *PostQueuesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post queues params +func (o *PostQueuesParams) WithHTTPClient(client *http.Client) *PostQueuesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post queues params +func (o *PostQueuesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithQueueRequest adds the queueRequest to the post queues params +func (o *PostQueuesParams) WithQueueRequest(queueRequest *voip_models.QueueRequest) *PostQueuesParams { + o.SetQueueRequest(queueRequest) + return o +} + +// SetQueueRequest adds the queueRequest to the post queues params +func (o *PostQueuesParams) SetQueueRequest(queueRequest *voip_models.QueueRequest) { + o.QueueRequest = queueRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostQueuesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.QueueRequest != nil { + if err := r.SetBodyParam(o.QueueRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/voip/voip_client/queue/post_queues_responses.go b/api/voip/voip_client/queue/post_queues_responses.go new file mode 100644 index 0000000..b0a0d3e --- /dev/null +++ b/api/voip/voip_client/queue/post_queues_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package queue + +// 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/telnexus/lib/api/voip/voip_models" +) + +// PostQueuesReader is a Reader for the PostQueues structure. +type PostQueuesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostQueuesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostQueuesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostQueuesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostQueuesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostQueuesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostQueuesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostQueuesInternalServerError() + 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()) + } +} + +// NewPostQueuesOK creates a PostQueuesOK with default headers values +func NewPostQueuesOK() *PostQueuesOK { + return &PostQueuesOK{} +} + +/* PostQueuesOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of Queue objects +*/ +type PostQueuesOK struct { + Payload *voip_models.QueueResponse +} + +func (o *PostQueuesOK) Error() string { + return fmt.Sprintf("[POST /queues][%d] postQueuesOK %+v", 200, o.Payload) +} +func (o *PostQueuesOK) GetPayload() *voip_models.QueueResponse { + return o.Payload +} + +func (o *PostQueuesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.QueueResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostQueuesUnauthorized creates a PostQueuesUnauthorized with default headers values +func NewPostQueuesUnauthorized() *PostQueuesUnauthorized { + return &PostQueuesUnauthorized{} +} + +/* PostQueuesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostQueuesUnauthorized struct { + Payload *voip_models.Error +} + +func (o *PostQueuesUnauthorized) Error() string { + return fmt.Sprintf("[POST /queues][%d] postQueuesUnauthorized %+v", 401, o.Payload) +} +func (o *PostQueuesUnauthorized) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostQueuesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostQueuesForbidden creates a PostQueuesForbidden with default headers values +func NewPostQueuesForbidden() *PostQueuesForbidden { + return &PostQueuesForbidden{} +} + +/* PostQueuesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostQueuesForbidden struct { + Payload *voip_models.Error +} + +func (o *PostQueuesForbidden) Error() string { + return fmt.Sprintf("[POST /queues][%d] postQueuesForbidden %+v", 403, o.Payload) +} +func (o *PostQueuesForbidden) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostQueuesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostQueuesNotFound creates a PostQueuesNotFound with default headers values +func NewPostQueuesNotFound() *PostQueuesNotFound { + return &PostQueuesNotFound{} +} + +/* PostQueuesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostQueuesNotFound struct { + Payload *voip_models.Error +} + +func (o *PostQueuesNotFound) Error() string { + return fmt.Sprintf("[POST /queues][%d] postQueuesNotFound %+v", 404, o.Payload) +} +func (o *PostQueuesNotFound) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostQueuesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostQueuesUnprocessableEntity creates a PostQueuesUnprocessableEntity with default headers values +func NewPostQueuesUnprocessableEntity() *PostQueuesUnprocessableEntity { + return &PostQueuesUnprocessableEntity{} +} + +/* PostQueuesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostQueuesUnprocessableEntity struct { + Payload *voip_models.Error +} + +func (o *PostQueuesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /queues][%d] postQueuesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PostQueuesUnprocessableEntity) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostQueuesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostQueuesInternalServerError creates a PostQueuesInternalServerError with default headers values +func NewPostQueuesInternalServerError() *PostQueuesInternalServerError { + return &PostQueuesInternalServerError{} +} + +/* PostQueuesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostQueuesInternalServerError struct { + Payload *voip_models.Error +} + +func (o *PostQueuesInternalServerError) Error() string { + return fmt.Sprintf("[POST /queues][%d] postQueuesInternalServerError %+v", 500, o.Payload) +} +func (o *PostQueuesInternalServerError) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostQueuesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/voip/voip_client/queue/put_queues_parameters.go b/api/voip/voip_client/queue/put_queues_parameters.go new file mode 100644 index 0000000..d115dd2 --- /dev/null +++ b/api/voip/voip_client/queue/put_queues_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package queue + +// 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/telnexus/lib/api/voip/voip_models" +) + +// NewPutQueuesParams creates a new PutQueuesParams 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 NewPutQueuesParams() *PutQueuesParams { + return &PutQueuesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPutQueuesParamsWithTimeout creates a new PutQueuesParams object +// with the ability to set a timeout on a request. +func NewPutQueuesParamsWithTimeout(timeout time.Duration) *PutQueuesParams { + return &PutQueuesParams{ + timeout: timeout, + } +} + +// NewPutQueuesParamsWithContext creates a new PutQueuesParams object +// with the ability to set a context for a request. +func NewPutQueuesParamsWithContext(ctx context.Context) *PutQueuesParams { + return &PutQueuesParams{ + Context: ctx, + } +} + +// NewPutQueuesParamsWithHTTPClient creates a new PutQueuesParams object +// with the ability to set a custom HTTPClient for a request. +func NewPutQueuesParamsWithHTTPClient(client *http.Client) *PutQueuesParams { + return &PutQueuesParams{ + HTTPClient: client, + } +} + +/* PutQueuesParams contains all the parameters to send to the API endpoint + for the put queues operation. + + Typically these are written to a http.Request. +*/ +type PutQueuesParams struct { + + /* QueueRequest. + + An array of new Queues + */ + QueueRequest *voip_models.QueueRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put queues params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutQueuesParams) WithDefaults() *PutQueuesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put queues params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutQueuesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the put queues params +func (o *PutQueuesParams) WithTimeout(timeout time.Duration) *PutQueuesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put queues params +func (o *PutQueuesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put queues params +func (o *PutQueuesParams) WithContext(ctx context.Context) *PutQueuesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put queues params +func (o *PutQueuesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put queues params +func (o *PutQueuesParams) WithHTTPClient(client *http.Client) *PutQueuesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put queues params +func (o *PutQueuesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithQueueRequest adds the queueRequest to the put queues params +func (o *PutQueuesParams) WithQueueRequest(queueRequest *voip_models.QueueRequest) *PutQueuesParams { + o.SetQueueRequest(queueRequest) + return o +} + +// SetQueueRequest adds the queueRequest to the put queues params +func (o *PutQueuesParams) SetQueueRequest(queueRequest *voip_models.QueueRequest) { + o.QueueRequest = queueRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutQueuesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.QueueRequest != nil { + if err := r.SetBodyParam(o.QueueRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/voip/voip_client/queue/put_queues_responses.go b/api/voip/voip_client/queue/put_queues_responses.go new file mode 100644 index 0000000..d139e71 --- /dev/null +++ b/api/voip/voip_client/queue/put_queues_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package queue + +// 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/telnexus/lib/api/voip/voip_models" +) + +// PutQueuesReader is a Reader for the PutQueues structure. +type PutQueuesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutQueuesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutQueuesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutQueuesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutQueuesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutQueuesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutQueuesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutQueuesInternalServerError() + 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()) + } +} + +// NewPutQueuesOK creates a PutQueuesOK with default headers values +func NewPutQueuesOK() *PutQueuesOK { + return &PutQueuesOK{} +} + +/* PutQueuesOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of Queue objects +*/ +type PutQueuesOK struct { + Payload *voip_models.QueueResponse +} + +func (o *PutQueuesOK) Error() string { + return fmt.Sprintf("[PUT /queues][%d] putQueuesOK %+v", 200, o.Payload) +} +func (o *PutQueuesOK) GetPayload() *voip_models.QueueResponse { + return o.Payload +} + +func (o *PutQueuesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.QueueResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutQueuesUnauthorized creates a PutQueuesUnauthorized with default headers values +func NewPutQueuesUnauthorized() *PutQueuesUnauthorized { + return &PutQueuesUnauthorized{} +} + +/* PutQueuesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutQueuesUnauthorized struct { + Payload *voip_models.Error +} + +func (o *PutQueuesUnauthorized) Error() string { + return fmt.Sprintf("[PUT /queues][%d] putQueuesUnauthorized %+v", 401, o.Payload) +} +func (o *PutQueuesUnauthorized) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutQueuesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutQueuesForbidden creates a PutQueuesForbidden with default headers values +func NewPutQueuesForbidden() *PutQueuesForbidden { + return &PutQueuesForbidden{} +} + +/* PutQueuesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PutQueuesForbidden struct { + Payload *voip_models.Error +} + +func (o *PutQueuesForbidden) Error() string { + return fmt.Sprintf("[PUT /queues][%d] putQueuesForbidden %+v", 403, o.Payload) +} +func (o *PutQueuesForbidden) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutQueuesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutQueuesNotFound creates a PutQueuesNotFound with default headers values +func NewPutQueuesNotFound() *PutQueuesNotFound { + return &PutQueuesNotFound{} +} + +/* PutQueuesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PutQueuesNotFound struct { + Payload *voip_models.Error +} + +func (o *PutQueuesNotFound) Error() string { + return fmt.Sprintf("[PUT /queues][%d] putQueuesNotFound %+v", 404, o.Payload) +} +func (o *PutQueuesNotFound) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutQueuesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutQueuesUnprocessableEntity creates a PutQueuesUnprocessableEntity with default headers values +func NewPutQueuesUnprocessableEntity() *PutQueuesUnprocessableEntity { + return &PutQueuesUnprocessableEntity{} +} + +/* PutQueuesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutQueuesUnprocessableEntity struct { + Payload *voip_models.Error +} + +func (o *PutQueuesUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /queues][%d] putQueuesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PutQueuesUnprocessableEntity) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutQueuesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutQueuesInternalServerError creates a PutQueuesInternalServerError with default headers values +func NewPutQueuesInternalServerError() *PutQueuesInternalServerError { + return &PutQueuesInternalServerError{} +} + +/* PutQueuesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PutQueuesInternalServerError struct { + Payload *voip_models.Error +} + +func (o *PutQueuesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /queues][%d] putQueuesInternalServerError %+v", 500, o.Payload) +} +func (o *PutQueuesInternalServerError) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutQueuesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/voip/voip_client/queue/queue_client.go b/api/voip/voip_client/queue/queue_client.go new file mode 100644 index 0000000..34018b8 --- /dev/null +++ b/api/voip/voip_client/queue/queue_client.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package queue + +// 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 queue API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for queue 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 { + GetQueues(params *GetQueuesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetQueuesOK, error) + + PostQueues(params *PostQueuesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostQueuesOK, error) + + PutQueues(params *PutQueuesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutQueuesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetQueues gets a list of queues + + Return a list of available Queues +*/ +func (a *Client) GetQueues(params *GetQueuesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetQueuesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetQueuesParams() + } + op := &runtime.ClientOperation{ + ID: "getQueues", + Method: "GET", + PathPattern: "/queues", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetQueuesReader{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.(*GetQueuesOK) + 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 getQueues: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostQueues adds new queues + + Create new Queues +*/ +func (a *Client) PostQueues(params *PostQueuesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostQueuesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostQueuesParams() + } + op := &runtime.ClientOperation{ + ID: "postQueues", + Method: "POST", + PathPattern: "/queues", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostQueuesReader{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.(*PostQueuesOK) + 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 postQueues: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutQueues updates queues + + Update fields in Queue records identified by Telnexus Id +*/ +func (a *Client) PutQueues(params *PutQueuesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutQueuesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutQueuesParams() + } + op := &runtime.ClientOperation{ + ID: "putQueues", + Method: "PUT", + PathPattern: "/queues", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutQueuesReader{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.(*PutQueuesOK) + 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 putQueues: 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 +} diff --git a/api/voip/voip_client/vm_box/get_vm_boxes_parameters.go b/api/voip/voip_client/vm_box/get_vm_boxes_parameters.go new file mode 100644 index 0000000..0d040a7 --- /dev/null +++ b/api/voip/voip_client/vm_box/get_vm_boxes_parameters.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vm_box + +// 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" +) + +// NewGetVMBoxesParams creates a new GetVMBoxesParams 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 NewGetVMBoxesParams() *GetVMBoxesParams { + return &GetVMBoxesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetVMBoxesParamsWithTimeout creates a new GetVMBoxesParams object +// with the ability to set a timeout on a request. +func NewGetVMBoxesParamsWithTimeout(timeout time.Duration) *GetVMBoxesParams { + return &GetVMBoxesParams{ + timeout: timeout, + } +} + +// NewGetVMBoxesParamsWithContext creates a new GetVMBoxesParams object +// with the ability to set a context for a request. +func NewGetVMBoxesParamsWithContext(ctx context.Context) *GetVMBoxesParams { + return &GetVMBoxesParams{ + Context: ctx, + } +} + +// NewGetVMBoxesParamsWithHTTPClient creates a new GetVMBoxesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetVMBoxesParamsWithHTTPClient(client *http.Client) *GetVMBoxesParams { + return &GetVMBoxesParams{ + HTTPClient: client, + } +} + +/* GetVMBoxesParams contains all the parameters to send to the API endpoint + for the get Vm boxes operation. + + Typically these are written to a http.Request. +*/ +type GetVMBoxesParams struct { + + /* Limit. + + How many objects to return at one time (max 300, default 100) + + Format: int64 + Default: 100 + */ + Limit *int64 + + /* Offset. + + How many objects to skip? (default 0) + + Format: int64 + */ + Offset *int64 + + /* VMBoxID. + + Telnexus Id of the vmBox to be retrieved + */ + VMBoxID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get Vm boxes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVMBoxesParams) WithDefaults() *GetVMBoxesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get Vm boxes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVMBoxesParams) SetDefaults() { + var ( + limitDefault = int64(100) + + offsetDefault = int64(0) + ) + + val := GetVMBoxesParams{ + Limit: &limitDefault, + Offset: &offsetDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the get Vm boxes params +func (o *GetVMBoxesParams) WithTimeout(timeout time.Duration) *GetVMBoxesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get Vm boxes params +func (o *GetVMBoxesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get Vm boxes params +func (o *GetVMBoxesParams) WithContext(ctx context.Context) *GetVMBoxesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get Vm boxes params +func (o *GetVMBoxesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get Vm boxes params +func (o *GetVMBoxesParams) WithHTTPClient(client *http.Client) *GetVMBoxesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get Vm boxes params +func (o *GetVMBoxesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the get Vm boxes params +func (o *GetVMBoxesParams) WithLimit(limit *int64) *GetVMBoxesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get Vm boxes params +func (o *GetVMBoxesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get Vm boxes params +func (o *GetVMBoxesParams) WithOffset(offset *int64) *GetVMBoxesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get Vm boxes params +func (o *GetVMBoxesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithVMBoxID adds the vMBoxID to the get Vm boxes params +func (o *GetVMBoxesParams) WithVMBoxID(vMBoxID *string) *GetVMBoxesParams { + o.SetVMBoxID(vMBoxID) + return o +} + +// SetVMBoxID adds the vmBoxId to the get Vm boxes params +func (o *GetVMBoxesParams) SetVMBoxID(vMBoxID *string) { + o.VMBoxID = vMBoxID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetVMBoxesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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 o.VMBoxID != nil { + + // query param vmBoxId + var qrVMBoxID string + + if o.VMBoxID != nil { + qrVMBoxID = *o.VMBoxID + } + qVMBoxID := qrVMBoxID + if qVMBoxID != "" { + + if err := r.SetQueryParam("vmBoxId", qVMBoxID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/voip/voip_client/vm_box/get_vm_boxes_responses.go b/api/voip/voip_client/vm_box/get_vm_boxes_responses.go new file mode 100644 index 0000000..7082e84 --- /dev/null +++ b/api/voip/voip_client/vm_box/get_vm_boxes_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vm_box + +// 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/telnexus/lib/api/voip/voip_models" +) + +// GetVMBoxesReader is a Reader for the GetVMBoxes structure. +type GetVMBoxesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetVMBoxesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetVMBoxesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetVMBoxesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetVMBoxesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetVMBoxesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetVMBoxesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetVMBoxesInternalServerError() + 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()) + } +} + +// NewGetVMBoxesOK creates a GetVMBoxesOK with default headers values +func NewGetVMBoxesOK() *GetVMBoxesOK { + return &GetVMBoxesOK{} +} + +/* GetVMBoxesOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of PBX objects +*/ +type GetVMBoxesOK struct { + Payload *voip_models.VMBoxResponse +} + +func (o *GetVMBoxesOK) Error() string { + return fmt.Sprintf("[GET /vmboxes][%d] getVmBoxesOK %+v", 200, o.Payload) +} +func (o *GetVMBoxesOK) GetPayload() *voip_models.VMBoxResponse { + return o.Payload +} + +func (o *GetVMBoxesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.VMBoxResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetVMBoxesUnauthorized creates a GetVMBoxesUnauthorized with default headers values +func NewGetVMBoxesUnauthorized() *GetVMBoxesUnauthorized { + return &GetVMBoxesUnauthorized{} +} + +/* GetVMBoxesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetVMBoxesUnauthorized struct { + Payload *voip_models.Error +} + +func (o *GetVMBoxesUnauthorized) Error() string { + return fmt.Sprintf("[GET /vmboxes][%d] getVmBoxesUnauthorized %+v", 401, o.Payload) +} +func (o *GetVMBoxesUnauthorized) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetVMBoxesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetVMBoxesForbidden creates a GetVMBoxesForbidden with default headers values +func NewGetVMBoxesForbidden() *GetVMBoxesForbidden { + return &GetVMBoxesForbidden{} +} + +/* GetVMBoxesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetVMBoxesForbidden struct { + Payload *voip_models.Error +} + +func (o *GetVMBoxesForbidden) Error() string { + return fmt.Sprintf("[GET /vmboxes][%d] getVmBoxesForbidden %+v", 403, o.Payload) +} +func (o *GetVMBoxesForbidden) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetVMBoxesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetVMBoxesNotFound creates a GetVMBoxesNotFound with default headers values +func NewGetVMBoxesNotFound() *GetVMBoxesNotFound { + return &GetVMBoxesNotFound{} +} + +/* GetVMBoxesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetVMBoxesNotFound struct { + Payload *voip_models.Error +} + +func (o *GetVMBoxesNotFound) Error() string { + return fmt.Sprintf("[GET /vmboxes][%d] getVmBoxesNotFound %+v", 404, o.Payload) +} +func (o *GetVMBoxesNotFound) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetVMBoxesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetVMBoxesUnprocessableEntity creates a GetVMBoxesUnprocessableEntity with default headers values +func NewGetVMBoxesUnprocessableEntity() *GetVMBoxesUnprocessableEntity { + return &GetVMBoxesUnprocessableEntity{} +} + +/* GetVMBoxesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetVMBoxesUnprocessableEntity struct { + Payload *voip_models.Error +} + +func (o *GetVMBoxesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /vmboxes][%d] getVmBoxesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetVMBoxesUnprocessableEntity) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetVMBoxesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetVMBoxesInternalServerError creates a GetVMBoxesInternalServerError with default headers values +func NewGetVMBoxesInternalServerError() *GetVMBoxesInternalServerError { + return &GetVMBoxesInternalServerError{} +} + +/* GetVMBoxesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetVMBoxesInternalServerError struct { + Payload *voip_models.Error +} + +func (o *GetVMBoxesInternalServerError) Error() string { + return fmt.Sprintf("[GET /vmboxes][%d] getVmBoxesInternalServerError %+v", 500, o.Payload) +} +func (o *GetVMBoxesInternalServerError) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *GetVMBoxesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/voip/voip_client/vm_box/post_vm_boxes_parameters.go b/api/voip/voip_client/vm_box/post_vm_boxes_parameters.go new file mode 100644 index 0000000..105c6d7 --- /dev/null +++ b/api/voip/voip_client/vm_box/post_vm_boxes_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vm_box + +// 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/telnexus/lib/api/voip/voip_models" +) + +// NewPostVMBoxesParams creates a new PostVMBoxesParams 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 NewPostVMBoxesParams() *PostVMBoxesParams { + return &PostVMBoxesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostVMBoxesParamsWithTimeout creates a new PostVMBoxesParams object +// with the ability to set a timeout on a request. +func NewPostVMBoxesParamsWithTimeout(timeout time.Duration) *PostVMBoxesParams { + return &PostVMBoxesParams{ + timeout: timeout, + } +} + +// NewPostVMBoxesParamsWithContext creates a new PostVMBoxesParams object +// with the ability to set a context for a request. +func NewPostVMBoxesParamsWithContext(ctx context.Context) *PostVMBoxesParams { + return &PostVMBoxesParams{ + Context: ctx, + } +} + +// NewPostVMBoxesParamsWithHTTPClient creates a new PostVMBoxesParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostVMBoxesParamsWithHTTPClient(client *http.Client) *PostVMBoxesParams { + return &PostVMBoxesParams{ + HTTPClient: client, + } +} + +/* PostVMBoxesParams contains all the parameters to send to the API endpoint + for the post Vm boxes operation. + + Typically these are written to a http.Request. +*/ +type PostVMBoxesParams struct { + + /* VMBoxRequest. + + An array of new VmBoxes + */ + VMBoxRequest *voip_models.VMBoxRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post Vm boxes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostVMBoxesParams) WithDefaults() *PostVMBoxesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post Vm boxes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostVMBoxesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post Vm boxes params +func (o *PostVMBoxesParams) WithTimeout(timeout time.Duration) *PostVMBoxesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post Vm boxes params +func (o *PostVMBoxesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post Vm boxes params +func (o *PostVMBoxesParams) WithContext(ctx context.Context) *PostVMBoxesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post Vm boxes params +func (o *PostVMBoxesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post Vm boxes params +func (o *PostVMBoxesParams) WithHTTPClient(client *http.Client) *PostVMBoxesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post Vm boxes params +func (o *PostVMBoxesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithVMBoxRequest adds the vMBoxRequest to the post Vm boxes params +func (o *PostVMBoxesParams) WithVMBoxRequest(vMBoxRequest *voip_models.VMBoxRequest) *PostVMBoxesParams { + o.SetVMBoxRequest(vMBoxRequest) + return o +} + +// SetVMBoxRequest adds the vmBoxRequest to the post Vm boxes params +func (o *PostVMBoxesParams) SetVMBoxRequest(vMBoxRequest *voip_models.VMBoxRequest) { + o.VMBoxRequest = vMBoxRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostVMBoxesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.VMBoxRequest != nil { + if err := r.SetBodyParam(o.VMBoxRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/voip/voip_client/vm_box/post_vm_boxes_responses.go b/api/voip/voip_client/vm_box/post_vm_boxes_responses.go new file mode 100644 index 0000000..72970bc --- /dev/null +++ b/api/voip/voip_client/vm_box/post_vm_boxes_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vm_box + +// 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/telnexus/lib/api/voip/voip_models" +) + +// PostVMBoxesReader is a Reader for the PostVMBoxes structure. +type PostVMBoxesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostVMBoxesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostVMBoxesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostVMBoxesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostVMBoxesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostVMBoxesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostVMBoxesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostVMBoxesInternalServerError() + 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()) + } +} + +// NewPostVMBoxesOK creates a PostVMBoxesOK with default headers values +func NewPostVMBoxesOK() *PostVMBoxesOK { + return &PostVMBoxesOK{} +} + +/* PostVMBoxesOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of PBX objects +*/ +type PostVMBoxesOK struct { + Payload *voip_models.VMBoxResponse +} + +func (o *PostVMBoxesOK) Error() string { + return fmt.Sprintf("[POST /vmboxes][%d] postVmBoxesOK %+v", 200, o.Payload) +} +func (o *PostVMBoxesOK) GetPayload() *voip_models.VMBoxResponse { + return o.Payload +} + +func (o *PostVMBoxesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.VMBoxResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostVMBoxesUnauthorized creates a PostVMBoxesUnauthorized with default headers values +func NewPostVMBoxesUnauthorized() *PostVMBoxesUnauthorized { + return &PostVMBoxesUnauthorized{} +} + +/* PostVMBoxesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostVMBoxesUnauthorized struct { + Payload *voip_models.Error +} + +func (o *PostVMBoxesUnauthorized) Error() string { + return fmt.Sprintf("[POST /vmboxes][%d] postVmBoxesUnauthorized %+v", 401, o.Payload) +} +func (o *PostVMBoxesUnauthorized) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostVMBoxesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostVMBoxesForbidden creates a PostVMBoxesForbidden with default headers values +func NewPostVMBoxesForbidden() *PostVMBoxesForbidden { + return &PostVMBoxesForbidden{} +} + +/* PostVMBoxesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostVMBoxesForbidden struct { + Payload *voip_models.Error +} + +func (o *PostVMBoxesForbidden) Error() string { + return fmt.Sprintf("[POST /vmboxes][%d] postVmBoxesForbidden %+v", 403, o.Payload) +} +func (o *PostVMBoxesForbidden) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostVMBoxesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostVMBoxesNotFound creates a PostVMBoxesNotFound with default headers values +func NewPostVMBoxesNotFound() *PostVMBoxesNotFound { + return &PostVMBoxesNotFound{} +} + +/* PostVMBoxesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostVMBoxesNotFound struct { + Payload *voip_models.Error +} + +func (o *PostVMBoxesNotFound) Error() string { + return fmt.Sprintf("[POST /vmboxes][%d] postVmBoxesNotFound %+v", 404, o.Payload) +} +func (o *PostVMBoxesNotFound) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostVMBoxesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostVMBoxesUnprocessableEntity creates a PostVMBoxesUnprocessableEntity with default headers values +func NewPostVMBoxesUnprocessableEntity() *PostVMBoxesUnprocessableEntity { + return &PostVMBoxesUnprocessableEntity{} +} + +/* PostVMBoxesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostVMBoxesUnprocessableEntity struct { + Payload *voip_models.Error +} + +func (o *PostVMBoxesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /vmboxes][%d] postVmBoxesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PostVMBoxesUnprocessableEntity) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostVMBoxesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostVMBoxesInternalServerError creates a PostVMBoxesInternalServerError with default headers values +func NewPostVMBoxesInternalServerError() *PostVMBoxesInternalServerError { + return &PostVMBoxesInternalServerError{} +} + +/* PostVMBoxesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostVMBoxesInternalServerError struct { + Payload *voip_models.Error +} + +func (o *PostVMBoxesInternalServerError) Error() string { + return fmt.Sprintf("[POST /vmboxes][%d] postVmBoxesInternalServerError %+v", 500, o.Payload) +} +func (o *PostVMBoxesInternalServerError) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PostVMBoxesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/voip/voip_client/vm_box/put_vm_boxes_parameters.go b/api/voip/voip_client/vm_box/put_vm_boxes_parameters.go new file mode 100644 index 0000000..a0df32e --- /dev/null +++ b/api/voip/voip_client/vm_box/put_vm_boxes_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vm_box + +// 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/telnexus/lib/api/voip/voip_models" +) + +// NewPutVMBoxesParams creates a new PutVMBoxesParams 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 NewPutVMBoxesParams() *PutVMBoxesParams { + return &PutVMBoxesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPutVMBoxesParamsWithTimeout creates a new PutVMBoxesParams object +// with the ability to set a timeout on a request. +func NewPutVMBoxesParamsWithTimeout(timeout time.Duration) *PutVMBoxesParams { + return &PutVMBoxesParams{ + timeout: timeout, + } +} + +// NewPutVMBoxesParamsWithContext creates a new PutVMBoxesParams object +// with the ability to set a context for a request. +func NewPutVMBoxesParamsWithContext(ctx context.Context) *PutVMBoxesParams { + return &PutVMBoxesParams{ + Context: ctx, + } +} + +// NewPutVMBoxesParamsWithHTTPClient creates a new PutVMBoxesParams object +// with the ability to set a custom HTTPClient for a request. +func NewPutVMBoxesParamsWithHTTPClient(client *http.Client) *PutVMBoxesParams { + return &PutVMBoxesParams{ + HTTPClient: client, + } +} + +/* PutVMBoxesParams contains all the parameters to send to the API endpoint + for the put Vm boxes operation. + + Typically these are written to a http.Request. +*/ +type PutVMBoxesParams struct { + + /* VMBoxRequest. + + An array of new VmBoxes + */ + VMBoxRequest *voip_models.VMBoxRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put Vm boxes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutVMBoxesParams) WithDefaults() *PutVMBoxesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put Vm boxes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutVMBoxesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the put Vm boxes params +func (o *PutVMBoxesParams) WithTimeout(timeout time.Duration) *PutVMBoxesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put Vm boxes params +func (o *PutVMBoxesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put Vm boxes params +func (o *PutVMBoxesParams) WithContext(ctx context.Context) *PutVMBoxesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put Vm boxes params +func (o *PutVMBoxesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put Vm boxes params +func (o *PutVMBoxesParams) WithHTTPClient(client *http.Client) *PutVMBoxesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put Vm boxes params +func (o *PutVMBoxesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithVMBoxRequest adds the vMBoxRequest to the put Vm boxes params +func (o *PutVMBoxesParams) WithVMBoxRequest(vMBoxRequest *voip_models.VMBoxRequest) *PutVMBoxesParams { + o.SetVMBoxRequest(vMBoxRequest) + return o +} + +// SetVMBoxRequest adds the vmBoxRequest to the put Vm boxes params +func (o *PutVMBoxesParams) SetVMBoxRequest(vMBoxRequest *voip_models.VMBoxRequest) { + o.VMBoxRequest = vMBoxRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutVMBoxesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.VMBoxRequest != nil { + if err := r.SetBodyParam(o.VMBoxRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/voip/voip_client/vm_box/put_vm_boxes_responses.go b/api/voip/voip_client/vm_box/put_vm_boxes_responses.go new file mode 100644 index 0000000..c76e473 --- /dev/null +++ b/api/voip/voip_client/vm_box/put_vm_boxes_responses.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vm_box + +// 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/telnexus/lib/api/voip/voip_models" +) + +// PutVMBoxesReader is a Reader for the PutVMBoxes structure. +type PutVMBoxesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutVMBoxesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutVMBoxesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutVMBoxesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutVMBoxesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutVMBoxesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutVMBoxesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutVMBoxesInternalServerError() + 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()) + } +} + +// NewPutVMBoxesOK creates a PutVMBoxesOK with default headers values +func NewPutVMBoxesOK() *PutVMBoxesOK { + return &PutVMBoxesOK{} +} + +/* PutVMBoxesOK describes a response with status code 200, with default header values. + +Telnexus Response with an array of PBX objects +*/ +type PutVMBoxesOK struct { + Payload *voip_models.VMBoxResponse +} + +func (o *PutVMBoxesOK) Error() string { + return fmt.Sprintf("[PUT /vmboxes][%d] putVmBoxesOK %+v", 200, o.Payload) +} +func (o *PutVMBoxesOK) GetPayload() *voip_models.VMBoxResponse { + return o.Payload +} + +func (o *PutVMBoxesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.VMBoxResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutVMBoxesUnauthorized creates a PutVMBoxesUnauthorized with default headers values +func NewPutVMBoxesUnauthorized() *PutVMBoxesUnauthorized { + return &PutVMBoxesUnauthorized{} +} + +/* PutVMBoxesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutVMBoxesUnauthorized struct { + Payload *voip_models.Error +} + +func (o *PutVMBoxesUnauthorized) Error() string { + return fmt.Sprintf("[PUT /vmboxes][%d] putVmBoxesUnauthorized %+v", 401, o.Payload) +} +func (o *PutVMBoxesUnauthorized) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutVMBoxesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutVMBoxesForbidden creates a PutVMBoxesForbidden with default headers values +func NewPutVMBoxesForbidden() *PutVMBoxesForbidden { + return &PutVMBoxesForbidden{} +} + +/* PutVMBoxesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PutVMBoxesForbidden struct { + Payload *voip_models.Error +} + +func (o *PutVMBoxesForbidden) Error() string { + return fmt.Sprintf("[PUT /vmboxes][%d] putVmBoxesForbidden %+v", 403, o.Payload) +} +func (o *PutVMBoxesForbidden) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutVMBoxesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutVMBoxesNotFound creates a PutVMBoxesNotFound with default headers values +func NewPutVMBoxesNotFound() *PutVMBoxesNotFound { + return &PutVMBoxesNotFound{} +} + +/* PutVMBoxesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PutVMBoxesNotFound struct { + Payload *voip_models.Error +} + +func (o *PutVMBoxesNotFound) Error() string { + return fmt.Sprintf("[PUT /vmboxes][%d] putVmBoxesNotFound %+v", 404, o.Payload) +} +func (o *PutVMBoxesNotFound) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutVMBoxesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutVMBoxesUnprocessableEntity creates a PutVMBoxesUnprocessableEntity with default headers values +func NewPutVMBoxesUnprocessableEntity() *PutVMBoxesUnprocessableEntity { + return &PutVMBoxesUnprocessableEntity{} +} + +/* PutVMBoxesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutVMBoxesUnprocessableEntity struct { + Payload *voip_models.Error +} + +func (o *PutVMBoxesUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /vmboxes][%d] putVmBoxesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PutVMBoxesUnprocessableEntity) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutVMBoxesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutVMBoxesInternalServerError creates a PutVMBoxesInternalServerError with default headers values +func NewPutVMBoxesInternalServerError() *PutVMBoxesInternalServerError { + return &PutVMBoxesInternalServerError{} +} + +/* PutVMBoxesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PutVMBoxesInternalServerError struct { + Payload *voip_models.Error +} + +func (o *PutVMBoxesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /vmboxes][%d] putVmBoxesInternalServerError %+v", 500, o.Payload) +} +func (o *PutVMBoxesInternalServerError) GetPayload() *voip_models.Error { + return o.Payload +} + +func (o *PutVMBoxesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(voip_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/voip/voip_client/vm_box/vm_box_client.go b/api/voip/voip_client/vm_box/vm_box_client.go new file mode 100644 index 0000000..3d31634 --- /dev/null +++ b/api/voip/voip_client/vm_box/vm_box_client.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vm_box + +// 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 vm box API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for vm box 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 { + GetVMBoxes(params *GetVMBoxesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetVMBoxesOK, error) + + PostVMBoxes(params *PostVMBoxesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostVMBoxesOK, error) + + PutVMBoxes(params *PutVMBoxesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutVMBoxesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetVMBoxes gets a list of voice mail boxes + + Return a list of available Voice Mail Box entities +*/ +func (a *Client) GetVMBoxes(params *GetVMBoxesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetVMBoxesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetVMBoxesParams() + } + op := &runtime.ClientOperation{ + ID: "getVmBoxes", + Method: "GET", + PathPattern: "/vmboxes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetVMBoxesReader{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.(*GetVMBoxesOK) + 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 getVmBoxes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostVMBoxes adds new voice mail boxes + + Create new VmBoxes +*/ +func (a *Client) PostVMBoxes(params *PostVMBoxesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostVMBoxesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostVMBoxesParams() + } + op := &runtime.ClientOperation{ + ID: "postVmBoxes", + Method: "POST", + PathPattern: "/vmboxes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostVMBoxesReader{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.(*PostVMBoxesOK) + 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 postVmBoxes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutVMBoxes updates voice mail boxes + + Update fields in Voice Mail Box records identified by Telnexus Id +*/ +func (a *Client) PutVMBoxes(params *PutVMBoxesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutVMBoxesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutVMBoxesParams() + } + op := &runtime.ClientOperation{ + ID: "putVmBoxes", + Method: "PUT", + PathPattern: "/vmboxes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutVMBoxesReader{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.(*PutVMBoxesOK) + 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 putVmBoxes: 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 +} diff --git a/api/voip/voip_client/voip_client.go b/api/voip/voip_client/voip_client.go new file mode 100644 index 0000000..5a48154 --- /dev/null +++ b/api/voip/voip_client/voip_client.go @@ -0,0 +1,146 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_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" + + "code.tnxs.net/telnexus/lib/api/voip/voip_client/authority" + "code.tnxs.net/telnexus/lib/api/voip/voip_client/endpoint" + "code.tnxs.net/telnexus/lib/api/voip/voip_client/pbx" + "code.tnxs.net/telnexus/lib/api/voip/voip_client/pbx_user" + "code.tnxs.net/telnexus/lib/api/voip/voip_client/phone_number" + "code.tnxs.net/telnexus/lib/api/voip/voip_client/queue" + "code.tnxs.net/telnexus/lib/api/voip/voip_client/vm_box" +) + +// Default voip HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "voip.infra.tnxs.net:8080" + // 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 +var DefaultSchemes = []string{"http"} + +// NewHTTPClient creates a new voip HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Voip { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new voip HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Voip { + // ensure nullable parameters have default + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new voip client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Voip { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Voip) + cli.Transport = transport + cli.Authority = authority.New(transport, formats) + cli.Endpoint = endpoint.New(transport, formats) + cli.Pbx = pbx.New(transport, formats) + cli.PbxUser = pbx_user.New(transport, formats) + cli.PhoneNumber = phone_number.New(transport, formats) + cli.Queue = queue.New(transport, formats) + cli.VMBox = vm_box.New(transport, formats) + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// Voip is a client for voip +type Voip struct { + Authority authority.ClientService + + Endpoint endpoint.ClientService + + Pbx pbx.ClientService + + PbxUser pbx_user.ClientService + + PhoneNumber phone_number.ClientService + + Queue queue.ClientService + + VMBox vm_box.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Voip) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.Authority.SetTransport(transport) + c.Endpoint.SetTransport(transport) + c.Pbx.SetTransport(transport) + c.PbxUser.SetTransport(transport) + c.PhoneNumber.SetTransport(transport) + c.Queue.SetTransport(transport) + c.VMBox.SetTransport(transport) +} diff --git a/api/voip/voip_models/authority.go b/api/voip/voip_models/authority.go new file mode 100644 index 0000000..3e3d33f --- /dev/null +++ b/api/voip/voip_models/authority.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_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" +) + +// Authority authority +// +// swagger:model Authority +type Authority struct { + + // Account + AccountID string `json:"AccountID,omitempty"` + + // Address Line 1 + AddressLine1 string `json:"AddressLine1,omitempty"` + + // Address Line 2 + AddressLine2 string `json:"AddressLine2,omitempty"` + + // Billing Telephone Number + BTN string `json:"BTN,omitempty"` + + // City + City string `json:"City,omitempty"` + + // Contact Name + ContactID string `json:"ContactID,omitempty"` + + // Country + Country string `json:"Country,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Authority Date + Date string `json:"Date,omitempty"` + + // Date Approved + DateApproved string `json:"DateApproved,omitempty"` + + // Telnexus Record Identifier + ID string `json:"ID,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Losing Carrier + LosingCarrier string `json:"LosingCarrier,omitempty"` + + // Authority Number + Name string `json:"Name,omitempty"` + + // Name Line 1 + NameLine1 string `json:"NameLine1,omitempty"` + + // Name Line 2 + NameLine2 string `json:"NameLine2,omitempty"` + + // Opportunity Name + OpportunityID string `json:"OpportunityID,omitempty"` + + // Order Number + OrderID string `json:"OrderID,omitempty"` + + // UUID Reference the master record that owns this item + ParentFK string `json:"ParentFK,omitempty"` + + // Zip Code + PostalCode string `json:"PostalCode,omitempty"` + + // Quote Name + QuoteID string `json:"QuoteID,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // State + State string `json:"State,omitempty"` + + // Status + Status string `json:"Status,omitempty"` + + // ID of the Template for this object instance + TemplateID string `json:"TemplateID,omitempty"` + + // Tenant that owns this object instance + TenantID string `json:"TenantID,omitempty"` + + // Transfer Date + TransferDate string `json:"TransferDate,omitempty"` + + // Authority Type + Type string `json:"Type,omitempty"` +} + +// Validate validates this authority +func (m *Authority) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this authority based on context it is used +func (m *Authority) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Authority) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Authority) UnmarshalBinary(b []byte) error { + var res Authority + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/authority_request.go b/api/voip/voip_models/authority_request.go new file mode 100644 index 0000000..c94560c --- /dev/null +++ b/api/voip/voip_models/authority_request.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AuthorityRequest authority request +// +// swagger:model AuthorityRequest +type AuthorityRequest struct { + + // data + Data []*Authority `json:"Data"` +} + +// Validate validates this authority request +func (m *AuthorityRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AuthorityRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this authority request based on the context it is used +func (m *AuthorityRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AuthorityRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *AuthorityRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AuthorityRequest) UnmarshalBinary(b []byte) error { + var res AuthorityRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/authority_response.go b/api/voip/voip_models/authority_response.go new file mode 100644 index 0000000..e6ab5a2 --- /dev/null +++ b/api/voip/voip_models/authority_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AuthorityResponse An array of Authority objects +// +// swagger:model AuthorityResponse +type AuthorityResponse struct { + + // data + Data []*Authority `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this authority response +func (m *AuthorityResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AuthorityResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *AuthorityResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this authority response based on the context it is used +func (m *AuthorityResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AuthorityResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *AuthorityResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *AuthorityResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AuthorityResponse) UnmarshalBinary(b []byte) error { + var res AuthorityResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/call_flow_action.go b/api/voip/voip_models/call_flow_action.go new file mode 100644 index 0000000..0187b73 --- /dev/null +++ b/api/voip/voip_models/call_flow_action.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CallFlowAction Call flows describe steps to take in order to process a phone call. They are trees of information related to a phone call such as "answer, play file, record file" etc. that are logically grouped together and ordered. +// +// swagger:model CallFlowAction +type CallFlowAction struct { + + // Children callflows + Children interface{} `json:"Children,omitempty"` + + // The data/arguments of the callflow module + Data interface{} `json:"Data,omitempty"` + + // Telnexus Record Identifier + ID string `json:"ID,omitempty"` + + // The name of the callflow module to execute at this node + // Max Length: 64 + // Min Length: 1 + Module string `json:"Module,omitempty"` +} + +// Validate validates this call flow action +func (m *CallFlowAction) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateModule(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CallFlowAction) validateModule(formats strfmt.Registry) error { + if swag.IsZero(m.Module) { // not required + return nil + } + + if err := validate.MinLength("Module", "body", m.Module, 1); err != nil { + return err + } + + if err := validate.MaxLength("Module", "body", m.Module, 64); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this call flow action based on context it is used +func (m *CallFlowAction) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CallFlowAction) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CallFlowAction) UnmarshalBinary(b []byte) error { + var res CallFlowAction + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/callflow.go b/api/voip/voip_models/callflow.go new file mode 100644 index 0000000..5d18cd5 --- /dev/null +++ b/api/voip/voip_models/callflow.go @@ -0,0 +1,249 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Callflow Call flows describe steps to take in order to process a phone call. They are trees of information related to a phone call such as "answer, play file, record file" etc. that are logically grouped together and ordered. +// +// swagger:model Callflow +type Callflow struct { + + // feature code + FeatureCode *CallflowFeatureCode `json:"FeatureCode,omitempty"` + + // Flags set by external applications + Flags []string `json:"Flags"` + + // A callflow node defines a module to execute, data to provide to that module, and zero or more children to branch to + Flow *CallFlowAction `json:"Flow,omitempty"` + + // Telnexus Record Identifier + ID string `json:"ID,omitempty"` + + // A list of static numbers that the callflow should execute for + // Unique: true + Numbers []string `json:"Numbers"` + + // A list of regular expressions that the callflow should execute for, with optional capture groups + Patterns []string `json:"Patterns"` +} + +// Validate validates this callflow +func (m *Callflow) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFeatureCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFlow(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNumbers(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePatterns(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Callflow) validateFeatureCode(formats strfmt.Registry) error { + if swag.IsZero(m.FeatureCode) { // not required + return nil + } + + if m.FeatureCode != nil { + if err := m.FeatureCode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("FeatureCode") + } + return err + } + } + + return nil +} + +func (m *Callflow) validateFlow(formats strfmt.Registry) error { + if swag.IsZero(m.Flow) { // not required + return nil + } + + if m.Flow != nil { + if err := m.Flow.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Flow") + } + return err + } + } + + return nil +} + +func (m *Callflow) validateNumbers(formats strfmt.Registry) error { + if swag.IsZero(m.Numbers) { // not required + return nil + } + + if err := validate.UniqueItems("Numbers", "body", m.Numbers); err != nil { + return err + } + + for i := 0; i < len(m.Numbers); i++ { + + if err := validate.MinLength("Numbers"+"."+strconv.Itoa(i), "body", m.Numbers[i], 1); err != nil { + return err + } + + if err := validate.MaxLength("Numbers"+"."+strconv.Itoa(i), "body", m.Numbers[i], 36); err != nil { + return err + } + + } + + return nil +} + +func (m *Callflow) validatePatterns(formats strfmt.Registry) error { + if swag.IsZero(m.Patterns) { // not required + return nil + } + + for i := 0; i < len(m.Patterns); i++ { + + if err := validate.MinLength("Patterns"+"."+strconv.Itoa(i), "body", m.Patterns[i], 1); err != nil { + return err + } + + } + + return nil +} + +// ContextValidate validate this callflow based on the context it is used +func (m *Callflow) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateFeatureCode(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFlow(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Callflow) contextValidateFeatureCode(ctx context.Context, formats strfmt.Registry) error { + + if m.FeatureCode != nil { + if err := m.FeatureCode.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("FeatureCode") + } + return err + } + } + + return nil +} + +func (m *Callflow) contextValidateFlow(ctx context.Context, formats strfmt.Registry) error { + + if m.Flow != nil { + if err := m.Flow.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Flow") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Callflow) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Callflow) UnmarshalBinary(b []byte) error { + var res Callflow + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CallflowFeatureCode When the callflow is used as a featurecode this object tracks the intended match of the pattern and name of the feature +// +// swagger:model CallflowFeatureCode +type CallflowFeatureCode struct { + + // name + Name string `json:"name,omitempty"` + + // number + Number string `json:"number,omitempty"` +} + +// Validate validates this callflow feature code +func (m *CallflowFeatureCode) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this callflow feature code based on context it is used +func (m *CallflowFeatureCode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CallflowFeatureCode) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CallflowFeatureCode) UnmarshalBinary(b []byte) error { + var res CallflowFeatureCode + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/endpoint.go b/api/voip/voip_models/endpoint.go new file mode 100644 index 0000000..fcb2d5c --- /dev/null +++ b/api/voip/voip_models/endpoint.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_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" +) + +// Endpoint endpoint +// +// swagger:model Endpoint +type Endpoint struct { + + // Asset ID + AssetID string `json:"AssetID,omitempty"` + + // Call Forwarding Record ID + CallForwardID string `json:"CallForwardID,omitempty"` + + // Call Restriction Record ID + CallRestrictionID string `json:"CallRestrictionID,omitempty"` + + // Endpoint CNAM Override + CallerIDOverride string `json:"CallerIdOverride,omitempty"` + + // Telnexus Contact ID + ContactID string `json:"ContactID,omitempty"` + + // Device Type + DeviceType string `json:"DeviceType,omitempty"` + + // Dial Plan + DialPlan string `json:"DialPlan,omitempty"` + + // Do Not Disturb + DoNotDisturb string `json:"DoNotDisturb,omitempty"` + + // Do Not Disturb Enabled? + DoNotDisturbEnabled bool `json:"DoNotDisturbEnabled,omitempty"` + + // Endpoint Enabled? + Enabled bool `json:"Enabled,omitempty"` + + // Endpoint Name + EndpointName string `json:"EndpointName,omitempty"` + + // Exclude From Queues? + ExcludeFromQueues bool `json:"ExcludeFromQueues,omitempty"` + + // Telnexus Record ID + ID string `json:"ID,omitempty"` + + // Kazoo Endpoint ID + KazooEndpointID string `json:"KazooEndpointID,omitempty"` + + // Endpoint Language Override + Language string `json:"Language,omitempty"` + + // MAC Address + MacAddress string `json:"MacAddress,omitempty"` + + // Music On Hold Override + MusicOnHold string `json:"MusicOnHold,omitempty"` + + // Kazoo MOH Media ID + MusicOnHoldMediaID string `json:"MusicOnHoldMediaID,omitempty"` + + // MWI Unassociated Updates? + MwiUnassociatedUpdates bool `json:"MwiUnassociatedUpdates,omitempty"` + + // Kazoo Owner ID + OwnerID string `json:"OwnerID,omitempty"` + + // Telnexus PBX ID + PbxID string `json:"PbxID,omitempty"` + + // Presence ID + PresenceID string `json:"PresenceID,omitempty"` + + // Provisioning Record ID + ProvisionID string `json:"ProvisionID,omitempty"` + + // Register Overwrite Notify? + RegisterOverwriteNotify bool `json:"RegisterOverwriteNotify,omitempty"` + + // Endpoint Ringtones + Ringtones string `json:"Ringtones,omitempty"` + + // Ringtones External + RingtonesExternal string `json:"RingtonesExternal,omitempty"` + + // Ringtones Internal + RingtonesInternal string `json:"RingtonesInternal,omitempty"` + + // SIP Information Record ID + SipID string `json:"SipID,omitempty"` + + // Suppress Unregister Notifications? + SuppressUnregisterNotifications bool `json:"SuppressUnregisterNotifications,omitempty"` + + // Endpoint Timezone Override + Timezone string `json:"Timezone,omitempty"` +} + +// Validate validates this endpoint +func (m *Endpoint) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this endpoint based on context it is used +func (m *Endpoint) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Endpoint) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Endpoint) UnmarshalBinary(b []byte) error { + var res Endpoint + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/endpoint_request.go b/api/voip/voip_models/endpoint_request.go new file mode 100644 index 0000000..1ec4b74 --- /dev/null +++ b/api/voip/voip_models/endpoint_request.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// EndpointRequest An array of Endpoint objects sent to be processed in a request +// +// swagger:model EndpointRequest +type EndpointRequest struct { + + // data + Data []*Endpoint `json:"Data"` +} + +// Validate validates this endpoint request +func (m *EndpointRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EndpointRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this endpoint request based on the context it is used +func (m *EndpointRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EndpointRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *EndpointRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EndpointRequest) UnmarshalBinary(b []byte) error { + var res EndpointRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/endpoint_response.go b/api/voip/voip_models/endpoint_response.go new file mode 100644 index 0000000..1f918ea --- /dev/null +++ b/api/voip/voip_models/endpoint_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// EndpointResponse An array of Endpoint objects sent in response to a request +// +// swagger:model EndpointResponse +type EndpointResponse struct { + + // data + Data []*Endpoint `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this endpoint response +func (m *EndpointResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EndpointResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *EndpointResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this endpoint response based on the context it is used +func (m *EndpointResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EndpointResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *EndpointResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *EndpointResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EndpointResponse) UnmarshalBinary(b []byte) error { + var res EndpointResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/error.go b/api/voip/voip_models/error.go new file mode 100644 index 0000000..3cd4773 --- /dev/null +++ b/api/voip/voip_models/error.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_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" +) + +// Error error +// +// swagger:model Error +type Error struct { + + // code + Code int32 `json:"Code,omitempty"` + + // fields + Fields string `json:"Fields,omitempty"` + + // message + Message string `json:"Message,omitempty"` +} + +// Validate validates this error +func (m *Error) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this error based on context it is used +func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Error) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Error) UnmarshalBinary(b []byte) error { + var res Error + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/pbx.go b/api/voip/voip_models/pbx.go new file mode 100644 index 0000000..116f34c --- /dev/null +++ b/api/voip/voip_models/pbx.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_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" +) + +// Pbx pbx +// +// swagger:model Pbx +type Pbx struct { + + // Telnexus Account ID + AccountID string `json:"AccountID,omitempty"` + + // Backend ID + BackendID string `json:"BackendID,omitempty"` + + // Billing Contact ID + BillingContact string `json:"BillingContact,omitempty"` + + // Kazoo Billing ID + BillingID string `json:"BillingID,omitempty"` + + // Kazoo Billing Mode + BillingMode string `json:"BillingMode,omitempty"` + + // Call Restriction Record ID + CallRestrictionID string `json:"CallRestrictionID,omitempty"` + + // Caller ID Emergency Name + CallerIDEmergencyName string `json:"CallerIdEmergencyName,omitempty"` + + // Caller ID Emergency Number + CallerIDEmergencyNumber string `json:"CallerIdEmergencyNumber,omitempty"` + + // Caller ID External Name + CallerIDExternalName string `json:"CallerIdExternalName,omitempty"` + + // Caller ID External Number + CallerIDExternalNumber string `json:"CallerIdExternalNumber,omitempty"` + + // Date Created + Created string `json:"Created,omitempty"` + + // User Enabled? + Enabled bool `json:"Enabled,omitempty"` + + // Telnexus ID + ID string `json:"ID,omitempty"` + + // Is Account a Reseller? + IsReseller bool `json:"IsReseller,omitempty"` + + // Kazoo Account Name + KazooAccountName string `json:"KazooAccountName,omitempty"` + + // Kazoo PBX ID + KazooID string `json:"KazooID,omitempty"` + + // Language + Language string `json:"Language,omitempty"` + + // Default Music On Hold + MusicOnHold string `json:"MusicOnHold,omitempty"` + + // PBX Name + Name string `json:"Name,omitempty"` + + // PBX Realm + Realm string `json:"Realm,omitempty"` + + // Reseller ID + ResellerID string `json:"ResellerID,omitempty"` + + // Technical Contact + TechnicalContactID string `json:"TechnicalContactID,omitempty"` + + // PBX Timezone + Timezone string `json:"Timezone,omitempty"` +} + +// Validate validates this pbx +func (m *Pbx) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this pbx based on context it is used +func (m *Pbx) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Pbx) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Pbx) UnmarshalBinary(b []byte) error { + var res Pbx + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/pbx_request.go b/api/voip/voip_models/pbx_request.go new file mode 100644 index 0000000..d3c0e07 --- /dev/null +++ b/api/voip/voip_models/pbx_request.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PbxRequest pbx request +// +// swagger:model PbxRequest +type PbxRequest struct { + + // data + Data []*Pbx `json:"Data"` +} + +// Validate validates this pbx request +func (m *PbxRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PbxRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this pbx request based on the context it is used +func (m *PbxRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PbxRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PbxRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PbxRequest) UnmarshalBinary(b []byte) error { + var res PbxRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/pbx_response.go b/api/voip/voip_models/pbx_response.go new file mode 100644 index 0000000..fe33c2b --- /dev/null +++ b/api/voip/voip_models/pbx_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PbxResponse An array of Authority objects +// +// swagger:model PbxResponse +type PbxResponse struct { + + // data + Data []*Pbx `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this pbx response +func (m *PbxResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PbxResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PbxResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this pbx response based on the context it is used +func (m *PbxResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PbxResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PbxResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PbxResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PbxResponse) UnmarshalBinary(b []byte) error { + var res PbxResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/pbx_user.go b/api/voip/voip_models/pbx_user.go new file mode 100644 index 0000000..6fe0a90 --- /dev/null +++ b/api/voip/voip_models/pbx_user.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_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" +) + +// PbxUser pbx user +// +// swagger:model PbxUser +type PbxUser struct { + + // Call Restriction Record ID + CallRestrictionID string `json:"CallRestrictionID,omitempty"` + + // CNAM Override + CallerID string `json:"CallerID,omitempty"` + + // Telnexus Contact ID + ContactID string `json:"ContactID,omitempty"` + + // Email Address + Email string `json:"Email,omitempty"` + + // Enabled? + Enabled bool `json:"Enabled,omitempty"` + + // Fax To Email Enabled? + FaxToEmailEnabled bool `json:"FaxToEmailEnabled,omitempty"` + + // First Name + FirstName string `json:"FirstName,omitempty"` + + // Telnexus ID + ID string `json:"ID,omitempty"` + + // Language + Language string `json:"Language,omitempty"` + + // Last Name + LastName string `json:"LastName,omitempty"` + + // Telnexus PBX ID + PbxID string `json:"PbxID,omitempty"` + + // Privilege Level + PrivLevel string `json:"PrivLevel,omitempty"` + + // RecordCall? + RecordCall bool `json:"RecordCall,omitempty"` + + // Require Passoword Update? + RequirePasswordUpdate bool `json:"RequirePasswordUpdate,omitempty"` + + // Timezone + Timezone string `json:"Timezone,omitempty"` + + // Kazoo User ID + UserID string `json:"UserID,omitempty"` + + // Kazoo Username + UserName string `json:"UserName,omitempty"` + + // Verified? + Verified bool `json:"Verified,omitempty"` + + // Voice Mail to Email Enabled? + VMToEmailEnabled bool `json:"VmToEmailEnabled,omitempty"` +} + +// Validate validates this pbx user +func (m *PbxUser) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this pbx user based on context it is used +func (m *PbxUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PbxUser) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PbxUser) UnmarshalBinary(b []byte) error { + var res PbxUser + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/pbx_user_request.go b/api/voip/voip_models/pbx_user_request.go new file mode 100644 index 0000000..06c7599 --- /dev/null +++ b/api/voip/voip_models/pbx_user_request.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PbxUserRequest pbx user request +// +// swagger:model PbxUserRequest +type PbxUserRequest struct { + + // data + Data []*PbxUser `json:"Data"` +} + +// Validate validates this pbx user request +func (m *PbxUserRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PbxUserRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this pbx user request based on the context it is used +func (m *PbxUserRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PbxUserRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PbxUserRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PbxUserRequest) UnmarshalBinary(b []byte) error { + var res PbxUserRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/pbx_user_response.go b/api/voip/voip_models/pbx_user_response.go new file mode 100644 index 0000000..a6528e2 --- /dev/null +++ b/api/voip/voip_models/pbx_user_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PbxUserResponse An array of PBX objects +// +// swagger:model PbxUserResponse +type PbxUserResponse struct { + + // data + Data []*PbxUser `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this pbx user response +func (m *PbxUserResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PbxUserResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PbxUserResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this pbx user response based on the context it is used +func (m *PbxUserResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PbxUserResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PbxUserResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PbxUserResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PbxUserResponse) UnmarshalBinary(b []byte) error { + var res PbxUserResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/phone_number.go b/api/voip/voip_models/phone_number.go new file mode 100644 index 0000000..adf7780 --- /dev/null +++ b/api/voip/voip_models/phone_number.go @@ -0,0 +1,132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_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" +) + +// PhoneNumber phone number +// +// swagger:model PhoneNumber +type PhoneNumber struct { + + // Telnexus Account ID + AccountID string `json:"AccountID,omitempty"` + + // AuthorityID + AuthorityID string `json:"AuthorityID,omitempty"` + + // Telnexus Company ID + CompanyID string `json:"CompanyID,omitempty"` + + // Telnexus Contact ID + ContactID string `json:"ContactID,omitempty"` + + // Telnexus Contract ID + ContractID string `json:"ContractID,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // Extension + Extension string `json:"Extension,omitempty"` + + // Fax Line? + FaxLine bool `json:"FaxLine,omitempty"` + + // Telnexus Record ID + ID string `json:"ID,omitempty"` + + // Indicator + Indicator string `json:"Indicator,omitempty"` + + // Local Service + LocalService bool `json:"LocalService,omitempty"` + + // Local Toll + LocalToll bool `json:"LocalToll,omitempty"` + + // Long Distance + LongDistance bool `json:"LongDistance,omitempty"` + + // Losing Carrier + LosingCarrier string `json:"LosingCarrier,omitempty"` + + // Telnexus Opportunity ID + OpportunityID string `json:"OpportunityID,omitempty"` + + // Telnexus Order ID + OrderID string `json:"OrderID,omitempty"` + + // Phone Number + PhoneNumber string `json:"PhoneNumber,omitempty"` + + // Is this number to ported out? + PortOut bool `json:"PortOut,omitempty"` + + // Telnexus Product ID + ProductID string `json:"ProductID,omitempty"` + + // Telnexus Quote ID + QuoteID string `json:"QuoteID,omitempty"` + + // Rate Center + Ratecenter string `json:"Ratecenter,omitempty"` + + // Is this a safety number? + Safety bool `json:"Safety,omitempty"` + + // Number Status + Status string `json:"Status,omitempty"` + + // Subscription ID + SubscriptionID string `json:"SubscriptionID,omitempty"` + + // Tollfree + Tollfree string `json:"Tollfree,omitempty"` + + // Number Type + Type string `json:"Type,omitempty"` + + // Wholesale Vendor ID + WholesalerID string `json:"WholesalerID,omitempty"` +} + +// Validate validates this phone number +func (m *PhoneNumber) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this phone number based on context it is used +func (m *PhoneNumber) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PhoneNumber) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PhoneNumber) UnmarshalBinary(b []byte) error { + var res PhoneNumber + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/phone_number_request.go b/api/voip/voip_models/phone_number_request.go new file mode 100644 index 0000000..b514c2f --- /dev/null +++ b/api/voip/voip_models/phone_number_request.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PhoneNumberRequest phone number request +// +// swagger:model PhoneNumberRequest +type PhoneNumberRequest struct { + + // data + Data []*PhoneNumber `json:"Data"` +} + +// Validate validates this phone number request +func (m *PhoneNumberRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PhoneNumberRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this phone number request based on the context it is used +func (m *PhoneNumberRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PhoneNumberRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PhoneNumberRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PhoneNumberRequest) UnmarshalBinary(b []byte) error { + var res PhoneNumberRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/phone_number_response.go b/api/voip/voip_models/phone_number_response.go new file mode 100644 index 0000000..267ea7c --- /dev/null +++ b/api/voip/voip_models/phone_number_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PhoneNumberResponse An array of Phone Number objects +// +// swagger:model PhoneNumberResponse +type PhoneNumberResponse struct { + + // data + Data []*PhoneNumber `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this phone number response +func (m *PhoneNumberResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PhoneNumberResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PhoneNumberResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this phone number response based on the context it is used +func (m *PhoneNumberResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PhoneNumberResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PhoneNumberResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PhoneNumberResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PhoneNumberResponse) UnmarshalBinary(b []byte) error { + var res PhoneNumberResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/queue.go b/api/voip/voip_models/queue.go new file mode 100644 index 0000000..a912d70 --- /dev/null +++ b/api/voip/voip_models/queue.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_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" +) + +// Queue queue +// +// swagger:model Queue +type Queue struct { + + // Pre-defined wait period applied after an agent handles a customer call (in seconds) + AgentWrapupTime int64 `json:"AgentWrapupTime,omitempty"` + + // If set to true and a recipient rejects a call, they will be forced to away state + ForceAwayOnReject bool `json:"ForceAwayOnReject,omitempty"` + + // Media ID (or appropriate media URI) of media to play while caller is on hold. + HoldTreatment string `json:"HoldTreatment,omitempty"` + + // Telnexus Record Identifier + ID string `json:"ID,omitempty"` + + // A friendly name for the queue + Name string `json:"Name,omitempty"` + + // The queue router used for routing and delivering calls to recipients + QueueRouter *string `json:"QueueRouter,omitempty"` + + // The type of queue + QueueType string `json:"QueueType,omitempty"` + + // Amount of time in seconds that qubicle will wait while ringing for the agent to successfully answer a call. + RingTimeout int64 `json:"RingTimeout,omitempty"` + + // The time between delivery ticks in milliseconds + TickTime int64 `json:"TickTime,omitempty"` + + // The maximum amount of time in seconds that a call will wait in queue. + Timeout int64 `json:"Timeout,omitempty"` + + // If set to a non-zero value the queue will immediately time out any call entering the queue over the size + TimeoutIfSizeExceeds int64 `json:"TimeoutIfSizeExceeds,omitempty"` + + // If set to true and a call enters the queue while it has no logged in agents, the call will time out + TimeoutImmediatelyIfEmpty bool `json:"TimeoutImmediatelyIfEmpty,omitempty"` + + // The ID of a queue that the call will be sent to in the event of a timeout + TimoutRedirect string `json:"TimoutRedirect,omitempty"` +} + +// Validate validates this queue +func (m *Queue) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this queue based on context it is used +func (m *Queue) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Queue) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Queue) UnmarshalBinary(b []byte) error { + var res Queue + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/queue_request.go b/api/voip/voip_models/queue_request.go new file mode 100644 index 0000000..b347fa6 --- /dev/null +++ b/api/voip/voip_models/queue_request.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// QueueRequest queue request +// +// swagger:model QueueRequest +type QueueRequest struct { + + // data + Data []*Queue `json:"Data"` +} + +// Validate validates this queue request +func (m *QueueRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *QueueRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this queue request based on the context it is used +func (m *QueueRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *QueueRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *QueueRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *QueueRequest) UnmarshalBinary(b []byte) error { + var res QueueRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/queue_response.go b/api/voip/voip_models/queue_response.go new file mode 100644 index 0000000..3449c34 --- /dev/null +++ b/api/voip/voip_models/queue_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// QueueResponse An array of Recipient objects +// +// swagger:model QueueResponse +type QueueResponse struct { + + // data + Data []*Recipient `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this queue response +func (m *QueueResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *QueueResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *QueueResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this queue response based on the context it is used +func (m *QueueResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *QueueResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *QueueResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *QueueResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *QueueResponse) UnmarshalBinary(b []byte) error { + var res QueueResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/recipient.go b/api/voip/voip_models/recipient.go new file mode 100644 index 0000000..5bc3593 --- /dev/null +++ b/api/voip/voip_models/recipient.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_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" +) + +// Recipient recipient +// +// swagger:model Recipient +type Recipient struct { + + // availability state + AvailabilityState string `json:"AvailabilityState,omitempty"` + + // available + Available string `json:"Available,omitempty"` + + // handling call + HandlingCall string `json:"HandlingCall,omitempty"` + + // Telnexus Record Identifier + ID string `json:"ID,omitempty"` + + // node + Node string `json:"Node,omitempty"` + + // offered call + OfferedCall string `json:"OfferedCall,omitempty"` + + // queue availability + QueueAvailability string `json:"QueueAvailability,omitempty"` + + // stats + Stats *RecipientStats `json:"Stats,omitempty"` + + // wiretap mode + WiretapMode string `json:"WiretapMode,omitempty"` + + // wiretapping recipient + WiretappingRecipient string `json:"WiretappingRecipient,omitempty"` + + // wrapup time seconds + WrapupTimeSeconds string `json:"WrapupTimeSeconds,omitempty"` +} + +// Validate validates this recipient +func (m *Recipient) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateStats(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Recipient) validateStats(formats strfmt.Registry) error { + if swag.IsZero(m.Stats) { // not required + return nil + } + + if m.Stats != nil { + if err := m.Stats.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Stats") + } + return err + } + } + + return nil +} + +// ContextValidate validate this recipient based on the context it is used +func (m *Recipient) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateStats(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Recipient) contextValidateStats(ctx context.Context, formats strfmt.Registry) error { + + if m.Stats != nil { + if err := m.Stats.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Stats") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Recipient) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Recipient) UnmarshalBinary(b []byte) error { + var res Recipient + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/recipient_request.go b/api/voip/voip_models/recipient_request.go new file mode 100644 index 0000000..b7093a7 --- /dev/null +++ b/api/voip/voip_models/recipient_request.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RecipientRequest recipient request +// +// swagger:model RecipientRequest +type RecipientRequest struct { + + // data + Data []*Recipient `json:"Data"` +} + +// Validate validates this recipient request +func (m *RecipientRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RecipientRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this recipient request based on the context it is used +func (m *RecipientRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RecipientRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RecipientRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RecipientRequest) UnmarshalBinary(b []byte) error { + var res RecipientRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/recipient_response.go b/api/voip/voip_models/recipient_response.go new file mode 100644 index 0000000..cd10c70 --- /dev/null +++ b/api/voip/voip_models/recipient_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RecipientResponse An array of Recipient objects +// +// swagger:model RecipientResponse +type RecipientResponse struct { + + // data + Data []*Recipient `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this recipient response +func (m *RecipientResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RecipientResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *RecipientResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this recipient response based on the context it is used +func (m *RecipientResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RecipientResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *RecipientResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RecipientResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RecipientResponse) UnmarshalBinary(b []byte) error { + var res RecipientResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/recipient_stats.go b/api/voip/voip_models/recipient_stats.go new file mode 100644 index 0000000..03693d3 --- /dev/null +++ b/api/voip/voip_models/recipient_stats.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_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" +) + +// RecipientStats recipient stats +// +// swagger:model RecipientStats +type RecipientStats struct { + + // avg call time + AvgCallTime float64 `json:"AvgCallTime,omitempty"` + + // Telnexus Record Identifier + ID string `json:"ID,omitempty"` + + // last action time + LastActionTime float64 `json:"LastActionTime,omitempty"` + + // last handled time + LastHandledTime float64 `json:"LastHandledTime,omitempty"` + + // login time + LoginTime int64 `json:"LoginTime,omitempty"` + + // missed calls + MissedCalls int64 `json:"MissedCalls,omitempty"` + + // total calls + TotalCalls int64 `json:"TotalCalls,omitempty"` +} + +// Validate validates this recipient stats +func (m *RecipientStats) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this recipient stats based on context it is used +func (m *RecipientStats) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RecipientStats) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RecipientStats) UnmarshalBinary(b []byte) error { + var res RecipientStats + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/response_meta.go b/api/voip/voip_models/response_meta.go new file mode 100644 index 0000000..38821ee --- /dev/null +++ b/api/voip/voip_models/response_meta.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_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" +) + +// ResponseMeta response meta +// +// swagger:model ResponseMeta +type ResponseMeta struct { + + // Microservice Contact Info + Contact string `json:"Contact,omitempty"` + + // Copyright Info + Copyright string `json:"Copyright,omitempty"` + + // License Information and Restrictions + License string `json:"License,omitempty"` + + // Request IP Address + RequestIP string `json:"RequestIP,omitempty"` + + // Request Type + RequestType string `json:"RequestType,omitempty"` + + // Request URL + RequestURL string `json:"RequestURL,omitempty"` + + // Data Server Info + ServerInfo string `json:"ServerInfo,omitempty"` + + // Data Server Response Time (ms) + ServerResponseTime string `json:"ServerResponseTime,omitempty"` + + // Backend Server Timestamp + ServerTimestamp string `json:"ServerTimestamp,omitempty"` + + // Telnexus Account Number used for recording transactions + TelnexusAccount string `json:"TelnexusAccount,omitempty"` + + // Operation ID + OperationID string `json:"operationId,omitempty"` +} + +// Validate validates this response meta +func (m *ResponseMeta) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this response meta based on context it is used +func (m *ResponseMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ResponseMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ResponseMeta) UnmarshalBinary(b []byte) error { + var res ResponseMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/vm_box.go b/api/voip/voip_models/vm_box.go new file mode 100644 index 0000000..87daa2f --- /dev/null +++ b/api/voip/voip_models/vm_box.go @@ -0,0 +1,93 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_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" +) + +// VMBox Vm box +// +// swagger:model VmBox +type VMBox struct { + + // Check if VM owner is owner of endpoint + CheckIfOwner bool `json:"CheckIfOwner,omitempty"` + + // Delete VM after notification + DeleteAfterNotify bool `json:"DeleteAfterNotify,omitempty"` + + // Telnexus Record ID + ID string `json:"ID,omitempty"` + + // Is this VM Box setup? + IsSetup bool `json:"IsSetup,omitempty"` + + // Kazoo Mailbox Id + KazooID string `json:"KazooID,omitempty"` + + // Kazoo User Id + KazooOwnerID string `json:"KazooOwnerID,omitempty"` + + // Kazoo Mailbox Number + MailboxNumber string `json:"MailboxNumber,omitempty"` + + // Mailbox Name + Name string `json:"Name,omitempty"` + + // Not Configurable? + NotConfigurable bool `json:"NotConfigurable,omitempty"` + + // Telnexus PBX ID + PbxID string `json:"PbxID,omitempty"` + + // Require PIN? + RequirePIN bool `json:"RequirePIN,omitempty"` + + // Save after notify? + SaveAfterNotify bool `json:"SaveAfterNotify,omitempty"` + + // Skip Greeting? + SkipGreeting bool `json:"SkipGreeting,omitempty"` + + // Skip Instructions? + SkipInstructions bool `json:"SkipInstructions,omitempty"` +} + +// Validate validates this Vm box +func (m *VMBox) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this Vm box based on context it is used +func (m *VMBox) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *VMBox) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VMBox) UnmarshalBinary(b []byte) error { + var res VMBox + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/vm_box_request.go b/api/voip/voip_models/vm_box_request.go new file mode 100644 index 0000000..bb85f4a --- /dev/null +++ b/api/voip/voip_models/vm_box_request.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VMBoxRequest Vm box request +// +// swagger:model VmBoxRequest +type VMBoxRequest struct { + + // data + Data []*VMBox `json:"Data"` +} + +// Validate validates this Vm box request +func (m *VMBoxRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VMBoxRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this Vm box request based on the context it is used +func (m *VMBoxRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VMBoxRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VMBoxRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VMBoxRequest) UnmarshalBinary(b []byte) error { + var res VMBoxRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/voip/voip_models/vm_box_response.go b/api/voip/voip_models/vm_box_response.go new file mode 100644 index 0000000..604ef38 --- /dev/null +++ b/api/voip/voip_models/vm_box_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package voip_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VMBoxResponse An array of VmBox objects +// +// swagger:model VmBoxResponse +type VMBoxResponse struct { + + // data + Data []*VMBox `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this Vm box response +func (m *VMBoxResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VMBoxResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VMBoxResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this Vm box response based on the context it is used +func (m *VMBoxResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VMBoxResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VMBoxResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VMBoxResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VMBoxResponse) UnmarshalBinary(b []byte) error { + var res VMBoxResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/workflow/workflow_client/app_log/app_log_client.go b/api/workflow/workflow_client/app_log/app_log_client.go new file mode 100644 index 0000000..69523bf --- /dev/null +++ b/api/workflow/workflow_client/app_log/app_log_client.go @@ -0,0 +1,86 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package app_log + +// 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 app log API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for app log 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 { + PostAppLogs(params *PostAppLogsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAppLogsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + PostAppLogs posts app log messages + + Insert app log messages into workflow storage +*/ +func (a *Client) PostAppLogs(params *PostAppLogsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAppLogsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostAppLogsParams() + } + op := &runtime.ClientOperation{ + ID: "postAppLogs", + Method: "POST", + PathPattern: "/applogs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostAppLogsReader{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.(*PostAppLogsOK) + 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 postAppLogs: 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 +} diff --git a/api/workflow/workflow_client/app_log/post_app_logs_parameters.go b/api/workflow/workflow_client/app_log/post_app_logs_parameters.go new file mode 100644 index 0000000..fd28739 --- /dev/null +++ b/api/workflow/workflow_client/app_log/post_app_logs_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package app_log + +// 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/telnexus/lib/api/workflow/workflow_models" +) + +// NewPostAppLogsParams creates a new PostAppLogsParams 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 NewPostAppLogsParams() *PostAppLogsParams { + return &PostAppLogsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostAppLogsParamsWithTimeout creates a new PostAppLogsParams object +// with the ability to set a timeout on a request. +func NewPostAppLogsParamsWithTimeout(timeout time.Duration) *PostAppLogsParams { + return &PostAppLogsParams{ + timeout: timeout, + } +} + +// NewPostAppLogsParamsWithContext creates a new PostAppLogsParams object +// with the ability to set a context for a request. +func NewPostAppLogsParamsWithContext(ctx context.Context) *PostAppLogsParams { + return &PostAppLogsParams{ + Context: ctx, + } +} + +// NewPostAppLogsParamsWithHTTPClient creates a new PostAppLogsParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostAppLogsParamsWithHTTPClient(client *http.Client) *PostAppLogsParams { + return &PostAppLogsParams{ + HTTPClient: client, + } +} + +/* PostAppLogsParams contains all the parameters to send to the API endpoint + for the post app logs operation. + + Typically these are written to a http.Request. +*/ +type PostAppLogsParams struct { + + /* AppLogRequest. + + An array of new AppLog records + */ + AppLogRequest *workflow_models.AppLogRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post app logs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostAppLogsParams) WithDefaults() *PostAppLogsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post app logs params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostAppLogsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post app logs params +func (o *PostAppLogsParams) WithTimeout(timeout time.Duration) *PostAppLogsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post app logs params +func (o *PostAppLogsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post app logs params +func (o *PostAppLogsParams) WithContext(ctx context.Context) *PostAppLogsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post app logs params +func (o *PostAppLogsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post app logs params +func (o *PostAppLogsParams) WithHTTPClient(client *http.Client) *PostAppLogsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post app logs params +func (o *PostAppLogsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAppLogRequest adds the appLogRequest to the post app logs params +func (o *PostAppLogsParams) WithAppLogRequest(appLogRequest *workflow_models.AppLogRequest) *PostAppLogsParams { + o.SetAppLogRequest(appLogRequest) + return o +} + +// SetAppLogRequest adds the appLogRequest to the post app logs params +func (o *PostAppLogsParams) SetAppLogRequest(appLogRequest *workflow_models.AppLogRequest) { + o.AppLogRequest = appLogRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostAppLogsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.AppLogRequest != nil { + if err := r.SetBodyParam(o.AppLogRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/workflow/workflow_client/app_log/post_app_logs_responses.go b/api/workflow/workflow_client/app_log/post_app_logs_responses.go new file mode 100644 index 0000000..a4f9a71 --- /dev/null +++ b/api/workflow/workflow_client/app_log/post_app_logs_responses.go @@ -0,0 +1,315 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package app_log + +// 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/telnexus/lib/api/workflow/workflow_models" +) + +// PostAppLogsReader is a Reader for the PostAppLogs structure. +type PostAppLogsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostAppLogsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostAppLogsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostAppLogsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostAppLogsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostAppLogsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostAppLogsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostAppLogsInternalServerError() + 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()) + } +} + +// NewPostAppLogsOK creates a PostAppLogsOK with default headers values +func NewPostAppLogsOK() *PostAppLogsOK { + return &PostAppLogsOK{} +} + +/* PostAppLogsOK describes a response with status code 200, with default header values. + +Array of AppLogs +*/ +type PostAppLogsOK struct { + AccessControlAllowOrigin string + + Payload *workflow_models.AppLogResponse +} + +func (o *PostAppLogsOK) Error() string { + return fmt.Sprintf("[POST /applogs][%d] postAppLogsOK %+v", 200, o.Payload) +} +func (o *PostAppLogsOK) GetPayload() *workflow_models.AppLogResponse { + return o.Payload +} + +func (o *PostAppLogsOK) 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(workflow_models.AppLogResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAppLogsUnauthorized creates a PostAppLogsUnauthorized with default headers values +func NewPostAppLogsUnauthorized() *PostAppLogsUnauthorized { + return &PostAppLogsUnauthorized{} +} + +/* PostAppLogsUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostAppLogsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *workflow_models.Error +} + +func (o *PostAppLogsUnauthorized) Error() string { + return fmt.Sprintf("[POST /applogs][%d] postAppLogsUnauthorized %+v", 401, o.Payload) +} +func (o *PostAppLogsUnauthorized) GetPayload() *workflow_models.Error { + return o.Payload +} + +func (o *PostAppLogsUnauthorized) 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(workflow_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAppLogsForbidden creates a PostAppLogsForbidden with default headers values +func NewPostAppLogsForbidden() *PostAppLogsForbidden { + return &PostAppLogsForbidden{} +} + +/* PostAppLogsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostAppLogsForbidden struct { + AccessControlAllowOrigin string + + Payload *workflow_models.Error +} + +func (o *PostAppLogsForbidden) Error() string { + return fmt.Sprintf("[POST /applogs][%d] postAppLogsForbidden %+v", 403, o.Payload) +} +func (o *PostAppLogsForbidden) GetPayload() *workflow_models.Error { + return o.Payload +} + +func (o *PostAppLogsForbidden) 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(workflow_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAppLogsNotFound creates a PostAppLogsNotFound with default headers values +func NewPostAppLogsNotFound() *PostAppLogsNotFound { + return &PostAppLogsNotFound{} +} + +/* PostAppLogsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostAppLogsNotFound struct { + AccessControlAllowOrigin string + + Payload *workflow_models.Error +} + +func (o *PostAppLogsNotFound) Error() string { + return fmt.Sprintf("[POST /applogs][%d] postAppLogsNotFound %+v", 404, o.Payload) +} +func (o *PostAppLogsNotFound) GetPayload() *workflow_models.Error { + return o.Payload +} + +func (o *PostAppLogsNotFound) 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(workflow_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAppLogsUnprocessableEntity creates a PostAppLogsUnprocessableEntity with default headers values +func NewPostAppLogsUnprocessableEntity() *PostAppLogsUnprocessableEntity { + return &PostAppLogsUnprocessableEntity{} +} + +/* PostAppLogsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostAppLogsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *workflow_models.Error +} + +func (o *PostAppLogsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /applogs][%d] postAppLogsUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PostAppLogsUnprocessableEntity) GetPayload() *workflow_models.Error { + return o.Payload +} + +func (o *PostAppLogsUnprocessableEntity) 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(workflow_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAppLogsInternalServerError creates a PostAppLogsInternalServerError with default headers values +func NewPostAppLogsInternalServerError() *PostAppLogsInternalServerError { + return &PostAppLogsInternalServerError{} +} + +/* PostAppLogsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostAppLogsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *workflow_models.Error +} + +func (o *PostAppLogsInternalServerError) Error() string { + return fmt.Sprintf("[POST /applogs][%d] postAppLogsInternalServerError %+v", 500, o.Payload) +} +func (o *PostAppLogsInternalServerError) GetPayload() *workflow_models.Error { + return o.Payload +} + +func (o *PostAppLogsInternalServerError) 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(workflow_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/workflow/workflow_client/cors/app_log_options_parameters.go b/api/workflow/workflow_client/cors/app_log_options_parameters.go new file mode 100644 index 0000000..ea6c245 --- /dev/null +++ b/api/workflow/workflow_client/cors/app_log_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewAppLogOptionsParams creates a new AppLogOptionsParams 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 NewAppLogOptionsParams() *AppLogOptionsParams { + return &AppLogOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewAppLogOptionsParamsWithTimeout creates a new AppLogOptionsParams object +// with the ability to set a timeout on a request. +func NewAppLogOptionsParamsWithTimeout(timeout time.Duration) *AppLogOptionsParams { + return &AppLogOptionsParams{ + timeout: timeout, + } +} + +// NewAppLogOptionsParamsWithContext creates a new AppLogOptionsParams object +// with the ability to set a context for a request. +func NewAppLogOptionsParamsWithContext(ctx context.Context) *AppLogOptionsParams { + return &AppLogOptionsParams{ + Context: ctx, + } +} + +// NewAppLogOptionsParamsWithHTTPClient creates a new AppLogOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewAppLogOptionsParamsWithHTTPClient(client *http.Client) *AppLogOptionsParams { + return &AppLogOptionsParams{ + HTTPClient: client, + } +} + +/* AppLogOptionsParams contains all the parameters to send to the API endpoint + for the app log options operation. + + Typically these are written to a http.Request. +*/ +type AppLogOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the app log options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AppLogOptionsParams) WithDefaults() *AppLogOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the app log options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AppLogOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the app log options params +func (o *AppLogOptionsParams) WithTimeout(timeout time.Duration) *AppLogOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the app log options params +func (o *AppLogOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the app log options params +func (o *AppLogOptionsParams) WithContext(ctx context.Context) *AppLogOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the app log options params +func (o *AppLogOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the app log options params +func (o *AppLogOptionsParams) WithHTTPClient(client *http.Client) *AppLogOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the app log options params +func (o *AppLogOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *AppLogOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/workflow/workflow_client/cors/app_log_options_responses.go b/api/workflow/workflow_client/cors/app_log_options_responses.go new file mode 100644 index 0000000..6defabf --- /dev/null +++ b/api/workflow/workflow_client/cors/app_log_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// AppLogOptionsReader is a Reader for the AppLogOptions structure. +type AppLogOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AppLogOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewAppLogOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewAppLogOptionsOK creates a AppLogOptionsOK with default headers values +func NewAppLogOptionsOK() *AppLogOptionsOK { + return &AppLogOptionsOK{} +} + +/* AppLogOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type AppLogOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *AppLogOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /applogs][%d] appLogOptionsOK ", 200) +} + +func (o *AppLogOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/workflow/workflow_client/cors/cors_client.go b/api/workflow/workflow_client/cors/cors_client.go new file mode 100644 index 0000000..71a8d51 --- /dev/null +++ b/api/workflow/workflow_client/cors/cors_client.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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 cors API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for cors 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 { + AppLogOptions(params *AppLogOptionsParams, opts ...ClientOption) (*AppLogOptionsOK, error) + + EmailMessageOptions(params *EmailMessageOptionsParams, opts ...ClientOption) (*EmailMessageOptionsOK, error) + + OutgoingEmailMessageOptions(params *OutgoingEmailMessageOptionsParams, opts ...ClientOption) (*OutgoingEmailMessageOptionsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + AppLogOptions CORS support +*/ +func (a *Client) AppLogOptions(params *AppLogOptionsParams, opts ...ClientOption) (*AppLogOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAppLogOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "appLogOptions", + Method: "OPTIONS", + PathPattern: "/applogs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &AppLogOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*AppLogOptionsOK) + 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 appLogOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + EmailMessageOptions CORS support +*/ +func (a *Client) EmailMessageOptions(params *EmailMessageOptionsParams, opts ...ClientOption) (*EmailMessageOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewEmailMessageOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "emailMessageOptions", + Method: "OPTIONS", + PathPattern: "/emailmessages", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &EmailMessageOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*EmailMessageOptionsOK) + 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 emailMessageOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + OutgoingEmailMessageOptions CORS support +*/ +func (a *Client) OutgoingEmailMessageOptions(params *OutgoingEmailMessageOptionsParams, opts ...ClientOption) (*OutgoingEmailMessageOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewOutgoingEmailMessageOptionsParams() + } + op := &runtime.ClientOperation{ + ID: "outgoingEmailMessageOptions", + Method: "OPTIONS", + PathPattern: "/outgoingemailmessages", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &OutgoingEmailMessageOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*OutgoingEmailMessageOptionsOK) + 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 outgoingEmailMessageOptions: 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 +} diff --git a/api/workflow/workflow_client/cors/email_message_options_parameters.go b/api/workflow/workflow_client/cors/email_message_options_parameters.go new file mode 100644 index 0000000..63d5584 --- /dev/null +++ b/api/workflow/workflow_client/cors/email_message_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewEmailMessageOptionsParams creates a new EmailMessageOptionsParams 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 NewEmailMessageOptionsParams() *EmailMessageOptionsParams { + return &EmailMessageOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewEmailMessageOptionsParamsWithTimeout creates a new EmailMessageOptionsParams object +// with the ability to set a timeout on a request. +func NewEmailMessageOptionsParamsWithTimeout(timeout time.Duration) *EmailMessageOptionsParams { + return &EmailMessageOptionsParams{ + timeout: timeout, + } +} + +// NewEmailMessageOptionsParamsWithContext creates a new EmailMessageOptionsParams object +// with the ability to set a context for a request. +func NewEmailMessageOptionsParamsWithContext(ctx context.Context) *EmailMessageOptionsParams { + return &EmailMessageOptionsParams{ + Context: ctx, + } +} + +// NewEmailMessageOptionsParamsWithHTTPClient creates a new EmailMessageOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewEmailMessageOptionsParamsWithHTTPClient(client *http.Client) *EmailMessageOptionsParams { + return &EmailMessageOptionsParams{ + HTTPClient: client, + } +} + +/* EmailMessageOptionsParams contains all the parameters to send to the API endpoint + for the email message options operation. + + Typically these are written to a http.Request. +*/ +type EmailMessageOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the email message options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EmailMessageOptionsParams) WithDefaults() *EmailMessageOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the email message options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *EmailMessageOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the email message options params +func (o *EmailMessageOptionsParams) WithTimeout(timeout time.Duration) *EmailMessageOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the email message options params +func (o *EmailMessageOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the email message options params +func (o *EmailMessageOptionsParams) WithContext(ctx context.Context) *EmailMessageOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the email message options params +func (o *EmailMessageOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the email message options params +func (o *EmailMessageOptionsParams) WithHTTPClient(client *http.Client) *EmailMessageOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the email message options params +func (o *EmailMessageOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *EmailMessageOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/workflow/workflow_client/cors/email_message_options_responses.go b/api/workflow/workflow_client/cors/email_message_options_responses.go new file mode 100644 index 0000000..b94bc3a --- /dev/null +++ b/api/workflow/workflow_client/cors/email_message_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// EmailMessageOptionsReader is a Reader for the EmailMessageOptions structure. +type EmailMessageOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *EmailMessageOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewEmailMessageOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewEmailMessageOptionsOK creates a EmailMessageOptionsOK with default headers values +func NewEmailMessageOptionsOK() *EmailMessageOptionsOK { + return &EmailMessageOptionsOK{} +} + +/* EmailMessageOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type EmailMessageOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *EmailMessageOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /emailmessages][%d] emailMessageOptionsOK ", 200) +} + +func (o *EmailMessageOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/workflow/workflow_client/cors/outgoing_email_message_options_parameters.go b/api/workflow/workflow_client/cors/outgoing_email_message_options_parameters.go new file mode 100644 index 0000000..8b31ea7 --- /dev/null +++ b/api/workflow/workflow_client/cors/outgoing_email_message_options_parameters.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// NewOutgoingEmailMessageOptionsParams creates a new OutgoingEmailMessageOptionsParams 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 NewOutgoingEmailMessageOptionsParams() *OutgoingEmailMessageOptionsParams { + return &OutgoingEmailMessageOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewOutgoingEmailMessageOptionsParamsWithTimeout creates a new OutgoingEmailMessageOptionsParams object +// with the ability to set a timeout on a request. +func NewOutgoingEmailMessageOptionsParamsWithTimeout(timeout time.Duration) *OutgoingEmailMessageOptionsParams { + return &OutgoingEmailMessageOptionsParams{ + timeout: timeout, + } +} + +// NewOutgoingEmailMessageOptionsParamsWithContext creates a new OutgoingEmailMessageOptionsParams object +// with the ability to set a context for a request. +func NewOutgoingEmailMessageOptionsParamsWithContext(ctx context.Context) *OutgoingEmailMessageOptionsParams { + return &OutgoingEmailMessageOptionsParams{ + Context: ctx, + } +} + +// NewOutgoingEmailMessageOptionsParamsWithHTTPClient creates a new OutgoingEmailMessageOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewOutgoingEmailMessageOptionsParamsWithHTTPClient(client *http.Client) *OutgoingEmailMessageOptionsParams { + return &OutgoingEmailMessageOptionsParams{ + HTTPClient: client, + } +} + +/* OutgoingEmailMessageOptionsParams contains all the parameters to send to the API endpoint + for the outgoing email message options operation. + + Typically these are written to a http.Request. +*/ +type OutgoingEmailMessageOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the outgoing email message options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *OutgoingEmailMessageOptionsParams) WithDefaults() *OutgoingEmailMessageOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the outgoing email message options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *OutgoingEmailMessageOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the outgoing email message options params +func (o *OutgoingEmailMessageOptionsParams) WithTimeout(timeout time.Duration) *OutgoingEmailMessageOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the outgoing email message options params +func (o *OutgoingEmailMessageOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the outgoing email message options params +func (o *OutgoingEmailMessageOptionsParams) WithContext(ctx context.Context) *OutgoingEmailMessageOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the outgoing email message options params +func (o *OutgoingEmailMessageOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the outgoing email message options params +func (o *OutgoingEmailMessageOptionsParams) WithHTTPClient(client *http.Client) *OutgoingEmailMessageOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the outgoing email message options params +func (o *OutgoingEmailMessageOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *OutgoingEmailMessageOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/workflow/workflow_client/cors/outgoing_email_message_options_responses.go b/api/workflow/workflow_client/cors/outgoing_email_message_options_responses.go new file mode 100644 index 0000000..8201f46 --- /dev/null +++ b/api/workflow/workflow_client/cors/outgoing_email_message_options_responses.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cors + +// 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" +) + +// OutgoingEmailMessageOptionsReader is a Reader for the OutgoingEmailMessageOptions structure. +type OutgoingEmailMessageOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *OutgoingEmailMessageOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewOutgoingEmailMessageOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + 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()) + } +} + +// NewOutgoingEmailMessageOptionsOK creates a OutgoingEmailMessageOptionsOK with default headers values +func NewOutgoingEmailMessageOptionsOK() *OutgoingEmailMessageOptionsOK { + return &OutgoingEmailMessageOptionsOK{} +} + +/* OutgoingEmailMessageOptionsOK describes a response with status code 200, with default header values. + +CORS OPTIONS response +*/ +type OutgoingEmailMessageOptionsOK struct { + AccessControlAllowCredentials string + AccessControlAllowHeaders string + AccessControlAllowMethods string + AccessControlAllowOrigin string + AccessControlExposeHeaders string + AccessControlMaxAge string + CacheControl string +} + +func (o *OutgoingEmailMessageOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /outgoingemailmessages][%d] outgoingEmailMessageOptionsOK ", 200) +} + +func (o *OutgoingEmailMessageOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Credentials + hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials") + + if hdrAccessControlAllowCredentials != "" { + o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials + } + + // hydrates response header Access-Control-Allow-Headers + hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers") + + if hdrAccessControlAllowHeaders != "" { + o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders + } + + // hydrates response header Access-Control-Allow-Methods + hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods") + + if hdrAccessControlAllowMethods != "" { + o.AccessControlAllowMethods = hdrAccessControlAllowMethods + } + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + // hydrates response header Access-Control-Expose-Headers + hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers") + + if hdrAccessControlExposeHeaders != "" { + o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders + } + + // hydrates response header Access-Control-Max-Age + hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age") + + if hdrAccessControlMaxAge != "" { + o.AccessControlMaxAge = hdrAccessControlMaxAge + } + + // hydrates response header Cache-Control + hdrCacheControl := response.GetHeader("Cache-Control") + + if hdrCacheControl != "" { + o.CacheControl = hdrCacheControl + } + + return nil +} diff --git a/api/workflow/workflow_client/email_message/email_message_client.go b/api/workflow/workflow_client/email_message/email_message_client.go new file mode 100644 index 0000000..c5fa7c2 --- /dev/null +++ b/api/workflow/workflow_client/email_message/email_message_client.go @@ -0,0 +1,86 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package email_message + +// 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 email message API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for email message 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 { + GetEmailMessages(params *GetEmailMessagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetEmailMessagesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetEmailMessages gets email messages from data store + + Retrieves email messages from workflow storage +*/ +func (a *Client) GetEmailMessages(params *GetEmailMessagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetEmailMessagesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetEmailMessagesParams() + } + op := &runtime.ClientOperation{ + ID: "getEmailMessages", + Method: "GET", + PathPattern: "/emailmessages", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetEmailMessagesReader{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.(*GetEmailMessagesOK) + 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 getEmailMessages: 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 +} diff --git a/api/workflow/workflow_client/email_message/get_email_messages_parameters.go b/api/workflow/workflow_client/email_message/get_email_messages_parameters.go new file mode 100644 index 0000000..b5fbdd7 --- /dev/null +++ b/api/workflow/workflow_client/email_message/get_email_messages_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package email_message + +// 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" +) + +// NewGetEmailMessagesParams creates a new GetEmailMessagesParams 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 NewGetEmailMessagesParams() *GetEmailMessagesParams { + return &GetEmailMessagesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetEmailMessagesParamsWithTimeout creates a new GetEmailMessagesParams object +// with the ability to set a timeout on a request. +func NewGetEmailMessagesParamsWithTimeout(timeout time.Duration) *GetEmailMessagesParams { + return &GetEmailMessagesParams{ + timeout: timeout, + } +} + +// NewGetEmailMessagesParamsWithContext creates a new GetEmailMessagesParams object +// with the ability to set a context for a request. +func NewGetEmailMessagesParamsWithContext(ctx context.Context) *GetEmailMessagesParams { + return &GetEmailMessagesParams{ + Context: ctx, + } +} + +// NewGetEmailMessagesParamsWithHTTPClient creates a new GetEmailMessagesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetEmailMessagesParamsWithHTTPClient(client *http.Client) *GetEmailMessagesParams { + return &GetEmailMessagesParams{ + HTTPClient: client, + } +} + +/* GetEmailMessagesParams contains all the parameters to send to the API endpoint + for the get email messages operation. + + Typically these are written to a http.Request. +*/ +type GetEmailMessagesParams struct { + + /* EmailMessageID. + + Email Message ID + */ + EmailMessageID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get email messages params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetEmailMessagesParams) WithDefaults() *GetEmailMessagesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get email messages params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetEmailMessagesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get email messages params +func (o *GetEmailMessagesParams) WithTimeout(timeout time.Duration) *GetEmailMessagesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get email messages params +func (o *GetEmailMessagesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get email messages params +func (o *GetEmailMessagesParams) WithContext(ctx context.Context) *GetEmailMessagesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get email messages params +func (o *GetEmailMessagesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get email messages params +func (o *GetEmailMessagesParams) WithHTTPClient(client *http.Client) *GetEmailMessagesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get email messages params +func (o *GetEmailMessagesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEmailMessageID adds the emailMessageID to the get email messages params +func (o *GetEmailMessagesParams) WithEmailMessageID(emailMessageID *string) *GetEmailMessagesParams { + o.SetEmailMessageID(emailMessageID) + return o +} + +// SetEmailMessageID adds the emailMessageId to the get email messages params +func (o *GetEmailMessagesParams) SetEmailMessageID(emailMessageID *string) { + o.EmailMessageID = emailMessageID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetEmailMessagesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.EmailMessageID != nil { + + // query param emailMessageId + var qrEmailMessageID string + + if o.EmailMessageID != nil { + qrEmailMessageID = *o.EmailMessageID + } + qEmailMessageID := qrEmailMessageID + if qEmailMessageID != "" { + + if err := r.SetQueryParam("emailMessageId", qEmailMessageID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/workflow/workflow_client/email_message/get_email_messages_responses.go b/api/workflow/workflow_client/email_message/get_email_messages_responses.go new file mode 100644 index 0000000..8e665eb --- /dev/null +++ b/api/workflow/workflow_client/email_message/get_email_messages_responses.go @@ -0,0 +1,315 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package email_message + +// 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/telnexus/lib/api/workflow/workflow_models" +) + +// GetEmailMessagesReader is a Reader for the GetEmailMessages structure. +type GetEmailMessagesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetEmailMessagesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetEmailMessagesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetEmailMessagesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetEmailMessagesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetEmailMessagesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetEmailMessagesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetEmailMessagesInternalServerError() + 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()) + } +} + +// NewGetEmailMessagesOK creates a GetEmailMessagesOK with default headers values +func NewGetEmailMessagesOK() *GetEmailMessagesOK { + return &GetEmailMessagesOK{} +} + +/* GetEmailMessagesOK describes a response with status code 200, with default header values. + +Array of Email Messages +*/ +type GetEmailMessagesOK struct { + AccessControlAllowOrigin string + + Payload *workflow_models.EmailMessagesResponse +} + +func (o *GetEmailMessagesOK) Error() string { + return fmt.Sprintf("[GET /emailmessages][%d] getEmailMessagesOK %+v", 200, o.Payload) +} +func (o *GetEmailMessagesOK) GetPayload() *workflow_models.EmailMessagesResponse { + return o.Payload +} + +func (o *GetEmailMessagesOK) 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(workflow_models.EmailMessagesResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetEmailMessagesUnauthorized creates a GetEmailMessagesUnauthorized with default headers values +func NewGetEmailMessagesUnauthorized() *GetEmailMessagesUnauthorized { + return &GetEmailMessagesUnauthorized{} +} + +/* GetEmailMessagesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetEmailMessagesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *workflow_models.Error +} + +func (o *GetEmailMessagesUnauthorized) Error() string { + return fmt.Sprintf("[GET /emailmessages][%d] getEmailMessagesUnauthorized %+v", 401, o.Payload) +} +func (o *GetEmailMessagesUnauthorized) GetPayload() *workflow_models.Error { + return o.Payload +} + +func (o *GetEmailMessagesUnauthorized) 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(workflow_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetEmailMessagesForbidden creates a GetEmailMessagesForbidden with default headers values +func NewGetEmailMessagesForbidden() *GetEmailMessagesForbidden { + return &GetEmailMessagesForbidden{} +} + +/* GetEmailMessagesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetEmailMessagesForbidden struct { + AccessControlAllowOrigin string + + Payload *workflow_models.Error +} + +func (o *GetEmailMessagesForbidden) Error() string { + return fmt.Sprintf("[GET /emailmessages][%d] getEmailMessagesForbidden %+v", 403, o.Payload) +} +func (o *GetEmailMessagesForbidden) GetPayload() *workflow_models.Error { + return o.Payload +} + +func (o *GetEmailMessagesForbidden) 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(workflow_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetEmailMessagesNotFound creates a GetEmailMessagesNotFound with default headers values +func NewGetEmailMessagesNotFound() *GetEmailMessagesNotFound { + return &GetEmailMessagesNotFound{} +} + +/* GetEmailMessagesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetEmailMessagesNotFound struct { + AccessControlAllowOrigin string + + Payload *workflow_models.Error +} + +func (o *GetEmailMessagesNotFound) Error() string { + return fmt.Sprintf("[GET /emailmessages][%d] getEmailMessagesNotFound %+v", 404, o.Payload) +} +func (o *GetEmailMessagesNotFound) GetPayload() *workflow_models.Error { + return o.Payload +} + +func (o *GetEmailMessagesNotFound) 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(workflow_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetEmailMessagesUnprocessableEntity creates a GetEmailMessagesUnprocessableEntity with default headers values +func NewGetEmailMessagesUnprocessableEntity() *GetEmailMessagesUnprocessableEntity { + return &GetEmailMessagesUnprocessableEntity{} +} + +/* GetEmailMessagesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetEmailMessagesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *workflow_models.Error +} + +func (o *GetEmailMessagesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /emailmessages][%d] getEmailMessagesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *GetEmailMessagesUnprocessableEntity) GetPayload() *workflow_models.Error { + return o.Payload +} + +func (o *GetEmailMessagesUnprocessableEntity) 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(workflow_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetEmailMessagesInternalServerError creates a GetEmailMessagesInternalServerError with default headers values +func NewGetEmailMessagesInternalServerError() *GetEmailMessagesInternalServerError { + return &GetEmailMessagesInternalServerError{} +} + +/* GetEmailMessagesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetEmailMessagesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *workflow_models.Error +} + +func (o *GetEmailMessagesInternalServerError) Error() string { + return fmt.Sprintf("[GET /emailmessages][%d] getEmailMessagesInternalServerError %+v", 500, o.Payload) +} +func (o *GetEmailMessagesInternalServerError) GetPayload() *workflow_models.Error { + return o.Payload +} + +func (o *GetEmailMessagesInternalServerError) 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(workflow_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/workflow/workflow_client/outgoing_email_message/outgoing_email_message_client.go b/api/workflow/workflow_client/outgoing_email_message/outgoing_email_message_client.go new file mode 100644 index 0000000..c5e1df6 --- /dev/null +++ b/api/workflow/workflow_client/outgoing_email_message/outgoing_email_message_client.go @@ -0,0 +1,86 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package outgoing_email_message + +// 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 outgoing email message API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for outgoing email message 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 { + PostOutgoingEmailMessages(params *PostOutgoingEmailMessagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostOutgoingEmailMessagesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + PostOutgoingEmailMessages adds new email messages to the outgoing queue + + Insert new email messages into workflow storage +*/ +func (a *Client) PostOutgoingEmailMessages(params *PostOutgoingEmailMessagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostOutgoingEmailMessagesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostOutgoingEmailMessagesParams() + } + op := &runtime.ClientOperation{ + ID: "postOutgoingEmailMessages", + Method: "POST", + PathPattern: "/outgoingemailmessages", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostOutgoingEmailMessagesReader{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.(*PostOutgoingEmailMessagesOK) + 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 postOutgoingEmailMessages: 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 +} diff --git a/api/workflow/workflow_client/outgoing_email_message/post_outgoing_email_messages_parameters.go b/api/workflow/workflow_client/outgoing_email_message/post_outgoing_email_messages_parameters.go new file mode 100644 index 0000000..4b9ce7c --- /dev/null +++ b/api/workflow/workflow_client/outgoing_email_message/post_outgoing_email_messages_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package outgoing_email_message + +// 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/telnexus/lib/api/workflow/workflow_models" +) + +// NewPostOutgoingEmailMessagesParams creates a new PostOutgoingEmailMessagesParams 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 NewPostOutgoingEmailMessagesParams() *PostOutgoingEmailMessagesParams { + return &PostOutgoingEmailMessagesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostOutgoingEmailMessagesParamsWithTimeout creates a new PostOutgoingEmailMessagesParams object +// with the ability to set a timeout on a request. +func NewPostOutgoingEmailMessagesParamsWithTimeout(timeout time.Duration) *PostOutgoingEmailMessagesParams { + return &PostOutgoingEmailMessagesParams{ + timeout: timeout, + } +} + +// NewPostOutgoingEmailMessagesParamsWithContext creates a new PostOutgoingEmailMessagesParams object +// with the ability to set a context for a request. +func NewPostOutgoingEmailMessagesParamsWithContext(ctx context.Context) *PostOutgoingEmailMessagesParams { + return &PostOutgoingEmailMessagesParams{ + Context: ctx, + } +} + +// NewPostOutgoingEmailMessagesParamsWithHTTPClient creates a new PostOutgoingEmailMessagesParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostOutgoingEmailMessagesParamsWithHTTPClient(client *http.Client) *PostOutgoingEmailMessagesParams { + return &PostOutgoingEmailMessagesParams{ + HTTPClient: client, + } +} + +/* PostOutgoingEmailMessagesParams contains all the parameters to send to the API endpoint + for the post outgoing email messages operation. + + Typically these are written to a http.Request. +*/ +type PostOutgoingEmailMessagesParams struct { + + /* OutgoingEmailMessageRequest. + + An array of new Outgoing Email Message records + */ + OutgoingEmailMessageRequest *workflow_models.OutgoingEmailMessageRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post outgoing email messages params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostOutgoingEmailMessagesParams) WithDefaults() *PostOutgoingEmailMessagesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post outgoing email messages params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostOutgoingEmailMessagesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post outgoing email messages params +func (o *PostOutgoingEmailMessagesParams) WithTimeout(timeout time.Duration) *PostOutgoingEmailMessagesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post outgoing email messages params +func (o *PostOutgoingEmailMessagesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post outgoing email messages params +func (o *PostOutgoingEmailMessagesParams) WithContext(ctx context.Context) *PostOutgoingEmailMessagesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post outgoing email messages params +func (o *PostOutgoingEmailMessagesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post outgoing email messages params +func (o *PostOutgoingEmailMessagesParams) WithHTTPClient(client *http.Client) *PostOutgoingEmailMessagesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post outgoing email messages params +func (o *PostOutgoingEmailMessagesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithOutgoingEmailMessageRequest adds the outgoingEmailMessageRequest to the post outgoing email messages params +func (o *PostOutgoingEmailMessagesParams) WithOutgoingEmailMessageRequest(outgoingEmailMessageRequest *workflow_models.OutgoingEmailMessageRequest) *PostOutgoingEmailMessagesParams { + o.SetOutgoingEmailMessageRequest(outgoingEmailMessageRequest) + return o +} + +// SetOutgoingEmailMessageRequest adds the outgoingEmailMessageRequest to the post outgoing email messages params +func (o *PostOutgoingEmailMessagesParams) SetOutgoingEmailMessageRequest(outgoingEmailMessageRequest *workflow_models.OutgoingEmailMessageRequest) { + o.OutgoingEmailMessageRequest = outgoingEmailMessageRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostOutgoingEmailMessagesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.OutgoingEmailMessageRequest != nil { + if err := r.SetBodyParam(o.OutgoingEmailMessageRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/workflow/workflow_client/outgoing_email_message/post_outgoing_email_messages_responses.go b/api/workflow/workflow_client/outgoing_email_message/post_outgoing_email_messages_responses.go new file mode 100644 index 0000000..7de148b --- /dev/null +++ b/api/workflow/workflow_client/outgoing_email_message/post_outgoing_email_messages_responses.go @@ -0,0 +1,315 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package outgoing_email_message + +// 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/telnexus/lib/api/workflow/workflow_models" +) + +// PostOutgoingEmailMessagesReader is a Reader for the PostOutgoingEmailMessages structure. +type PostOutgoingEmailMessagesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostOutgoingEmailMessagesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostOutgoingEmailMessagesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostOutgoingEmailMessagesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostOutgoingEmailMessagesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostOutgoingEmailMessagesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostOutgoingEmailMessagesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostOutgoingEmailMessagesInternalServerError() + 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()) + } +} + +// NewPostOutgoingEmailMessagesOK creates a PostOutgoingEmailMessagesOK with default headers values +func NewPostOutgoingEmailMessagesOK() *PostOutgoingEmailMessagesOK { + return &PostOutgoingEmailMessagesOK{} +} + +/* PostOutgoingEmailMessagesOK describes a response with status code 200, with default header values. + +Array of Email Messages +*/ +type PostOutgoingEmailMessagesOK struct { + AccessControlAllowOrigin string + + Payload *workflow_models.EmailMessagesResponse +} + +func (o *PostOutgoingEmailMessagesOK) Error() string { + return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesOK %+v", 200, o.Payload) +} +func (o *PostOutgoingEmailMessagesOK) GetPayload() *workflow_models.EmailMessagesResponse { + return o.Payload +} + +func (o *PostOutgoingEmailMessagesOK) 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(workflow_models.EmailMessagesResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostOutgoingEmailMessagesUnauthorized creates a PostOutgoingEmailMessagesUnauthorized with default headers values +func NewPostOutgoingEmailMessagesUnauthorized() *PostOutgoingEmailMessagesUnauthorized { + return &PostOutgoingEmailMessagesUnauthorized{} +} + +/* PostOutgoingEmailMessagesUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostOutgoingEmailMessagesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *workflow_models.Error +} + +func (o *PostOutgoingEmailMessagesUnauthorized) Error() string { + return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesUnauthorized %+v", 401, o.Payload) +} +func (o *PostOutgoingEmailMessagesUnauthorized) GetPayload() *workflow_models.Error { + return o.Payload +} + +func (o *PostOutgoingEmailMessagesUnauthorized) 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(workflow_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostOutgoingEmailMessagesForbidden creates a PostOutgoingEmailMessagesForbidden with default headers values +func NewPostOutgoingEmailMessagesForbidden() *PostOutgoingEmailMessagesForbidden { + return &PostOutgoingEmailMessagesForbidden{} +} + +/* PostOutgoingEmailMessagesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostOutgoingEmailMessagesForbidden struct { + AccessControlAllowOrigin string + + Payload *workflow_models.Error +} + +func (o *PostOutgoingEmailMessagesForbidden) Error() string { + return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesForbidden %+v", 403, o.Payload) +} +func (o *PostOutgoingEmailMessagesForbidden) GetPayload() *workflow_models.Error { + return o.Payload +} + +func (o *PostOutgoingEmailMessagesForbidden) 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(workflow_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostOutgoingEmailMessagesNotFound creates a PostOutgoingEmailMessagesNotFound with default headers values +func NewPostOutgoingEmailMessagesNotFound() *PostOutgoingEmailMessagesNotFound { + return &PostOutgoingEmailMessagesNotFound{} +} + +/* PostOutgoingEmailMessagesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostOutgoingEmailMessagesNotFound struct { + AccessControlAllowOrigin string + + Payload *workflow_models.Error +} + +func (o *PostOutgoingEmailMessagesNotFound) Error() string { + return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesNotFound %+v", 404, o.Payload) +} +func (o *PostOutgoingEmailMessagesNotFound) GetPayload() *workflow_models.Error { + return o.Payload +} + +func (o *PostOutgoingEmailMessagesNotFound) 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(workflow_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostOutgoingEmailMessagesUnprocessableEntity creates a PostOutgoingEmailMessagesUnprocessableEntity with default headers values +func NewPostOutgoingEmailMessagesUnprocessableEntity() *PostOutgoingEmailMessagesUnprocessableEntity { + return &PostOutgoingEmailMessagesUnprocessableEntity{} +} + +/* PostOutgoingEmailMessagesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostOutgoingEmailMessagesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *workflow_models.Error +} + +func (o *PostOutgoingEmailMessagesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PostOutgoingEmailMessagesUnprocessableEntity) GetPayload() *workflow_models.Error { + return o.Payload +} + +func (o *PostOutgoingEmailMessagesUnprocessableEntity) 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(workflow_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostOutgoingEmailMessagesInternalServerError creates a PostOutgoingEmailMessagesInternalServerError with default headers values +func NewPostOutgoingEmailMessagesInternalServerError() *PostOutgoingEmailMessagesInternalServerError { + return &PostOutgoingEmailMessagesInternalServerError{} +} + +/* PostOutgoingEmailMessagesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostOutgoingEmailMessagesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *workflow_models.Error +} + +func (o *PostOutgoingEmailMessagesInternalServerError) Error() string { + return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesInternalServerError %+v", 500, o.Payload) +} +func (o *PostOutgoingEmailMessagesInternalServerError) GetPayload() *workflow_models.Error { + return o.Payload +} + +func (o *PostOutgoingEmailMessagesInternalServerError) 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(workflow_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/workflow/workflow_client/workflow_client.go b/api/workflow/workflow_client/workflow_client.go new file mode 100644 index 0000000..8842623 --- /dev/null +++ b/api/workflow/workflow_client/workflow_client.go @@ -0,0 +1,131 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package workflow_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" + + "code.tnxs.net/telnexus/lib/api/workflow/workflow_client/app_log" + "code.tnxs.net/telnexus/lib/api/workflow/workflow_client/cors" + "code.tnxs.net/telnexus/lib/api/workflow/workflow_client/email_message" + "code.tnxs.net/telnexus/lib/api/workflow/workflow_client/outgoing_email_message" +) + +// Default workflow HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "workflow.infra.tnxs.net:8080" + // 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 +var DefaultSchemes = []string{"http"} + +// NewHTTPClient creates a new workflow HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Workflow { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new workflow HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Workflow { + // ensure nullable parameters have default + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new workflow client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Workflow { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Workflow) + cli.Transport = transport + cli.AppLog = app_log.New(transport, formats) + cli.Cors = cors.New(transport, formats) + cli.EmailMessage = email_message.New(transport, formats) + cli.OutgoingEmailMessage = outgoing_email_message.New(transport, formats) + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// Workflow is a client for workflow +type Workflow struct { + AppLog app_log.ClientService + + Cors cors.ClientService + + EmailMessage email_message.ClientService + + OutgoingEmailMessage outgoing_email_message.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Workflow) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.AppLog.SetTransport(transport) + c.Cors.SetTransport(transport) + c.EmailMessage.SetTransport(transport) + c.OutgoingEmailMessage.SetTransport(transport) +} diff --git a/api/workflow/workflow_models/app_log.go b/api/workflow/workflow_models/app_log.go new file mode 100644 index 0000000..4661c7e --- /dev/null +++ b/api/workflow/workflow_models/app_log.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package workflow_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" +) + +// AppLog Application Log for human consumption +// +// swagger:model AppLog +type AppLog struct { + + // account ID + AccountID string `json:"AccountID,omitempty"` + + // company ID + CompanyID string `json:"CompanyID,omitempty"` + + // created by ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // created date + CreatedDate string `json:"CreatedDate,omitempty"` + + // ID + ID string `json:"ID,omitempty"` + + // message + Message string `json:"Message,omitempty"` + + // object ID + ObjectID string `json:"ObjectID,omitempty"` + + // object type + ObjectType string `json:"ObjectType,omitempty"` + + // severity + Severity string `json:"Severity,omitempty"` + + // source + Source string `json:"Source,omitempty"` + + // source timestamp + SourceTimestamp string `json:"SourceTimestamp,omitempty"` +} + +// Validate validates this app log +func (m *AppLog) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this app log based on context it is used +func (m *AppLog) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *AppLog) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AppLog) UnmarshalBinary(b []byte) error { + var res AppLog + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/workflow/workflow_models/app_log_request.go b/api/workflow/workflow_models/app_log_request.go new file mode 100644 index 0000000..c283d67 --- /dev/null +++ b/api/workflow/workflow_models/app_log_request.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package workflow_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AppLogRequest An array Telnexus Application Log objects +// +// swagger:model AppLogRequest +type AppLogRequest struct { + + // data + Data []*AppLog `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this app log request +func (m *AppLogRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AppLogRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *AppLogRequest) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this app log request based on the context it is used +func (m *AppLogRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AppLogRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *AppLogRequest) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *AppLogRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AppLogRequest) UnmarshalBinary(b []byte) error { + var res AppLogRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/workflow/workflow_models/app_log_response.go b/api/workflow/workflow_models/app_log_response.go new file mode 100644 index 0000000..c1192be --- /dev/null +++ b/api/workflow/workflow_models/app_log_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package workflow_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AppLogResponse An array Telnexus Application Log objects +// +// swagger:model AppLogResponse +type AppLogResponse struct { + + // data + Data []*AppLog `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this app log response +func (m *AppLogResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AppLogResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *AppLogResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this app log response based on the context it is used +func (m *AppLogResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AppLogResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *AppLogResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *AppLogResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AppLogResponse) UnmarshalBinary(b []byte) error { + var res AppLogResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/workflow/workflow_models/document.go b/api/workflow/workflow_models/document.go new file mode 100644 index 0000000..5ce90d7 --- /dev/null +++ b/api/workflow/workflow_models/document.go @@ -0,0 +1,233 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package workflow_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" +) + +// Document Telnexus Document +// +// swagger:model Document +type Document struct { + + // archived by ID + ArchivedByID string `json:"ArchivedByID,omitempty"` + + // archived date + ArchivedDate string `json:"ArchivedDate,omitempty"` + + // author ID + AuthorID string `json:"AuthorID,omitempty"` + + // body + // Format: byte + Body strfmt.Base64 `json:"Body,omitempty"` + + // body length + BodyLength int64 `json:"BodyLength,omitempty"` + + // comment count + CommentCount int64 `json:"CommentCount,omitempty"` + + // connection ID + ConnectionID string `json:"ConnectionID,omitempty"` + + // content asset ID + ContentAssetID string `json:"ContentAssetID,omitempty"` + + // content modification date + ContentModificationDate string `json:"ContentModificationDate,omitempty"` + + // content size + ContentSize int64 `json:"ContentSize,omitempty"` + + // content type + ContentType string `json:"ContentType,omitempty"` + + // content version document ID + ContentVersionDocumentID string `json:"ContentVersionDocumentID,omitempty"` + + // contnet document ID + ContnetDocumentID string `json:"ContnetDocumentID,omitempty"` + + // created by ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // created date + CreatedDate string `json:"CreatedDate,omitempty"` + + // d date + DDate string `json:"DDate,omitempty"` + + // description + Description string `json:"Description,omitempty"` + + // developer name + DeveloperName string `json:"DeveloperName,omitempty"` + + // discount + Discount float64 `json:"Discount,omitempty"` + + // document + // Format: byte + Document strfmt.Base64 `json:"Document,omitempty"` + + // document ID + DocumentID string `json:"DocumentID,omitempty"` + + // document sequence + DocumentSequence int64 `json:"DocumentSequence,omitempty"` + + // field + Field string `json:"Field,omitempty"` + + // file extension + FileExtension string `json:"FileExtension,omitempty"` + + // file type + FileType string `json:"FileType,omitempty"` + + // folder ID + FolderID string `json:"FolderID,omitempty"` + + // grand total + GrandTotal string `json:"GrandTotal,omitempty"` + + // ID + ID string `json:"ID,omitempty"` + + // inserted by ID + InsertedByID string `json:"InsertedByID,omitempty"` + + // is archived + IsArchived bool `json:"IsArchived,omitempty"` + + // is body searchable + IsBodySearchable bool `json:"IsBodySearchable,omitempty"` + + // is comment sub + IsCommentSub bool `json:"IsCommentSub,omitempty"` + + // is document sub + IsDocumentSub bool `json:"IsDocumentSub,omitempty"` + + // is internal use only + IsInternalUseOnly bool `json:"IsInternalUseOnly,omitempty"` + + // is public + IsPublic bool `json:"IsPublic,omitempty"` + + // is rich text + IsRichText bool `json:"IsRichText,omitempty"` + + // keywords + Keywords string `json:"Keywords,omitempty"` + + // last modified by ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // last modified date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // last viewed date + LastViewedDate string `json:"LastViewedDate,omitempty"` + + // latst published version ID + LatstPublishedVersionID string `json:"LatstPublishedVersionID,omitempty"` + + // like count + LikeCount int64 `json:"LikeCount,omitempty"` + + // link URL + LinkURL string `json:"LinkURL,omitempty"` + + // linked entity ID + LinkedEntityID string `json:"LinkedEntityID,omitempty"` + + // name + Name string `json:"Name,omitempty"` + + // namespace prefix + NamespacePrefix string `json:"NamespacePrefix,omitempty"` + + // network scope + NetworkScope string `json:"NetworkScope,omitempty"` + + // owner ID + OwnerID string `json:"OwnerID,omitempty"` + + // parent ID + ParentID string `json:"ParentID,omitempty"` + + // publishstatus + Publishstatus string `json:"Publishstatus,omitempty"` + + // quote ID + QuoteID string `json:"QuoteID,omitempty"` + + // related record ID + RelatedRecordID string `json:"RelatedRecordID,omitempty"` + + // share type + ShareType string `json:"ShareType,omitempty"` + + // sharing option + SharingOption string `json:"SharingOption,omitempty"` + + // sharing privacy + SharingPrivacy string `json:"SharingPrivacy,omitempty"` + + // title + Title string `json:"Title,omitempty"` + + // type + Type string `json:"Type,omitempty"` + + // URL + URL string `json:"URL,omitempty"` + + // user ID + UserID string `json:"UserID,omitempty"` + + // visibility + Visibility string `json:"Visibility,omitempty"` +} + +// Validate validates this document +func (m *Document) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this document based on context it is used +func (m *Document) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Document) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Document) UnmarshalBinary(b []byte) error { + var res Document + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/workflow/workflow_models/email_message.go b/api/workflow/workflow_models/email_message.go new file mode 100644 index 0000000..7504423 --- /dev/null +++ b/api/workflow/workflow_models/email_message.go @@ -0,0 +1,199 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package workflow_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" +) + +// EmailMessage email message +// +// swagger:model EmailMessage +type EmailMessage struct { + + // activity ID + ActivityID string `json:"ActivityID,omitempty"` + + // b c c address + BCCAddress string `json:"BCCAddress,omitempty"` + + // c c address + CCAddress string `json:"CCAddress,omitempty"` + + // created by ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // created date + CreatedDate string `json:"CreatedDate,omitempty"` + + // email message ID + EmailMessageID string `json:"EmailMessageID,omitempty"` + + // from address + FromAddress string `json:"FromAddress,omitempty"` + + // from name + FromName string `json:"FromName,omitempty"` + + // HTML + // Format: byte + HTML strfmt.Base64 `json:"HTML,omitempty"` + + // has attachment + HasAttachment bool `json:"HasAttachment,omitempty"` + + // headers + Headers *Headers `json:"Headers,omitempty"` + + // ID + ID string `json:"ID,omitempty"` + + // incoming + Incoming bool `json:"Incoming,omitempty"` + + // is client managed + IsClientManaged bool `json:"IsClientManaged,omitempty"` + + // is externally managed + IsExternallyManaged bool `json:"IsExternallyManaged,omitempty"` + + // last modified by ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // last modified date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // message date + MessageDate string `json:"MessageDate,omitempty"` + + // message identifier + MessageIdentifier string `json:"MessageIdentifier,omitempty"` + + // parent ID + ParentID string `json:"ParentID,omitempty"` + + // related to ID + RelatedToID string `json:"RelatedToID,omitempty"` + + // relation address + RelationAddress string `json:"RelationAddress,omitempty"` + + // relation ID + RelationID string `json:"RelationID,omitempty"` + + // relation object type + RelationObjectType string `json:"RelationObjectType,omitempty"` + + // relation type + RelationType string `json:"RelationType,omitempty"` + + // reply to email message ID + ReplyToEmailMessageID string `json:"ReplyToEmailMessageID,omitempty"` + + // status + Status string `json:"Status,omitempty"` + + // subject + Subject string `json:"Subject,omitempty"` + + // text + // Format: byte + Text strfmt.Base64 `json:"Text,omitempty"` + + // thread identifier + ThreadIdentifier string `json:"ThreadIdentifier,omitempty"` + + // to address + ToAddress string `json:"ToAddress,omitempty"` + + // validated from address + ValidatedFromAddress string `json:"ValidatedFromAddress,omitempty"` +} + +// Validate validates this email message +func (m *EmailMessage) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHeaders(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EmailMessage) validateHeaders(formats strfmt.Registry) error { + if swag.IsZero(m.Headers) { // not required + return nil + } + + if m.Headers != nil { + if err := m.Headers.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Headers") + } + return err + } + } + + return nil +} + +// ContextValidate validate this email message based on the context it is used +func (m *EmailMessage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateHeaders(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EmailMessage) contextValidateHeaders(ctx context.Context, formats strfmt.Registry) error { + + if m.Headers != nil { + if err := m.Headers.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Headers") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *EmailMessage) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EmailMessage) UnmarshalBinary(b []byte) error { + var res EmailMessage + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/workflow/workflow_models/email_message_request.go b/api/workflow/workflow_models/email_message_request.go new file mode 100644 index 0000000..fef3161 --- /dev/null +++ b/api/workflow/workflow_models/email_message_request.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package workflow_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// EmailMessageRequest An array Telnexus Send Email Message objects +// +// swagger:model EmailMessageRequest +type EmailMessageRequest struct { + + // data + Data []*EmailMessage `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this email message request +func (m *EmailMessageRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EmailMessageRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *EmailMessageRequest) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this email message request based on the context it is used +func (m *EmailMessageRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EmailMessageRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *EmailMessageRequest) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *EmailMessageRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EmailMessageRequest) UnmarshalBinary(b []byte) error { + var res EmailMessageRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/workflow/workflow_models/email_messages_response.go b/api/workflow/workflow_models/email_messages_response.go new file mode 100644 index 0000000..8883098 --- /dev/null +++ b/api/workflow/workflow_models/email_messages_response.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package workflow_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// EmailMessagesResponse An array Telnexus user objects +// +// swagger:model EmailMessagesResponse +type EmailMessagesResponse struct { + + // data + Data []*EmailMessage `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this email messages response +func (m *EmailMessagesResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EmailMessagesResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *EmailMessagesResponse) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this email messages response based on the context it is used +func (m *EmailMessagesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EmailMessagesResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *EmailMessagesResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *EmailMessagesResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EmailMessagesResponse) UnmarshalBinary(b []byte) error { + var res EmailMessagesResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/workflow/workflow_models/error.go b/api/workflow/workflow_models/error.go new file mode 100644 index 0000000..d2c8dcc --- /dev/null +++ b/api/workflow/workflow_models/error.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package workflow_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" +) + +// Error error +// +// swagger:model Error +type Error struct { + + // code + Code int32 `json:"Code,omitempty"` + + // fields + Fields string `json:"Fields,omitempty"` + + // message + Message string `json:"Message,omitempty"` +} + +// Validate validates this error +func (m *Error) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this error based on context it is used +func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Error) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Error) UnmarshalBinary(b []byte) error { + var res Error + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/workflow/workflow_models/headers.go b/api/workflow/workflow_models/headers.go new file mode 100644 index 0000000..e34df53 --- /dev/null +++ b/api/workflow/workflow_models/headers.go @@ -0,0 +1,57 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package workflow_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" +) + +// Headers headers +// +// swagger:model Headers +type Headers struct { + + // key + Key string `json:"Key,omitempty"` + + // values + Values [][]string `json:"Values"` +} + +// Validate validates this headers +func (m *Headers) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this headers based on context it is used +func (m *Headers) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Headers) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Headers) UnmarshalBinary(b []byte) error { + var res Headers + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/workflow/workflow_models/outgoing_email_message.go b/api/workflow/workflow_models/outgoing_email_message.go new file mode 100644 index 0000000..bd77691 --- /dev/null +++ b/api/workflow/workflow_models/outgoing_email_message.go @@ -0,0 +1,149 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package workflow_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" +) + +// OutgoingEmailMessage A new email message to be sent +// +// swagger:model OutgoingEmailMessage +type OutgoingEmailMessage struct { + + // b c c address + BCCAddress string `json:"BCCAddress,omitempty"` + + // c c address + CCAddress string `json:"CCAddress,omitempty"` + + // email message ID + EmailMessageID string `json:"EmailMessageID,omitempty"` + + // email template ID + EmailTemplateID string `json:"EmailTemplateID,omitempty"` + + // external ID + ExternalID string `json:"ExternalID,omitempty"` + + // from contact ID + FromContactID string `json:"FromContactID,omitempty"` + + // from name + FromName string `json:"FromName,omitempty"` + + // HTML + HTML string `json:"HTML,omitempty"` + + // headers + Headers *Headers `json:"Headers,omitempty"` + + // ID + ID string `json:"ID,omitempty"` + + // subject + Subject string `json:"Subject,omitempty"` + + // text + Text string `json:"Text,omitempty"` + + // to address + ToAddress string `json:"ToAddress,omitempty"` + + // to name + ToName string `json:"ToName,omitempty"` + + // validated from address + ValidatedFromAddress string `json:"ValidatedFromAddress,omitempty"` + + // who ID + WhoID string `json:"WhoID,omitempty"` +} + +// Validate validates this outgoing email message +func (m *OutgoingEmailMessage) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHeaders(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OutgoingEmailMessage) validateHeaders(formats strfmt.Registry) error { + if swag.IsZero(m.Headers) { // not required + return nil + } + + if m.Headers != nil { + if err := m.Headers.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Headers") + } + return err + } + } + + return nil +} + +// ContextValidate validate this outgoing email message based on the context it is used +func (m *OutgoingEmailMessage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateHeaders(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OutgoingEmailMessage) contextValidateHeaders(ctx context.Context, formats strfmt.Registry) error { + + if m.Headers != nil { + if err := m.Headers.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Headers") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *OutgoingEmailMessage) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OutgoingEmailMessage) UnmarshalBinary(b []byte) error { + var res OutgoingEmailMessage + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/workflow/workflow_models/outgoing_email_message_request.go b/api/workflow/workflow_models/outgoing_email_message_request.go new file mode 100644 index 0000000..c91eceb --- /dev/null +++ b/api/workflow/workflow_models/outgoing_email_message_request.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package workflow_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// OutgoingEmailMessageRequest An array Telnexus New Email Message objects +// +// swagger:model OutgoingEmailMessageRequest +type OutgoingEmailMessageRequest struct { + + // data + Data []*OutgoingEmailMessage `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this outgoing email message request +func (m *OutgoingEmailMessageRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OutgoingEmailMessageRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.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 { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *OutgoingEmailMessageRequest) validateMeta(formats strfmt.Registry) error { + if swag.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 { + return ve.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this outgoing email message request based on the context it is used +func (m *OutgoingEmailMessageRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OutgoingEmailMessageRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *OutgoingEmailMessageRequest) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *OutgoingEmailMessageRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OutgoingEmailMessageRequest) UnmarshalBinary(b []byte) error { + var res OutgoingEmailMessageRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/workflow/workflow_models/request_meta.go b/api/workflow/workflow_models/request_meta.go new file mode 100644 index 0000000..027ed10 --- /dev/null +++ b/api/workflow/workflow_models/request_meta.go @@ -0,0 +1,75 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package workflow_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RequestMeta request meta +// +// swagger:model RequestMeta +type RequestMeta struct { + + // Telnexus Account Number of the Reseller or OEM + // Required: true + TelnexusAccount *string `json:"TelnexusAccount"` +} + +// Validate validates this request meta +func (m *RequestMeta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTelnexusAccount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RequestMeta) validateTelnexusAccount(formats strfmt.Registry) error { + + if err := validate.Required("TelnexusAccount", "body", m.TelnexusAccount); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this request meta based on context it is used +func (m *RequestMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RequestMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RequestMeta) UnmarshalBinary(b []byte) error { + var res RequestMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/workflow/workflow_models/response_meta.go b/api/workflow/workflow_models/response_meta.go new file mode 100644 index 0000000..91cc747 --- /dev/null +++ b/api/workflow/workflow_models/response_meta.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Telnexus LLC +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package workflow_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" +) + +// ResponseMeta response meta +// +// swagger:model ResponseMeta +type ResponseMeta struct { + + // Microservice Contact Info + Contact string `json:"Contact,omitempty"` + + // Copyright Info + Copyright string `json:"Copyright,omitempty"` + + // License Information and Restrictions + License string `json:"License,omitempty"` + + // Operation ID + OperationID string `json:"OperationID,omitempty"` + + // Request IP Address + RequestIP string `json:"RequestIP,omitempty"` + + // Request Type + RequestType string `json:"RequestType,omitempty"` + + // Request URL + RequestURL string `json:"RequestURL,omitempty"` + + // Data Server Info + ServerInfo string `json:"ServerInfo,omitempty"` + + // Data Server Response Time (ms) + ServerResponseTime string `json:"ServerResponseTime,omitempty"` + + // Backend Server Timestamp + ServerTimestamp string `json:"ServerTimestamp,omitempty"` + + // Telnexus Account Number used for recording transactions + TelnexusAccount string `json:"TelnexusAccount,omitempty"` +} + +// Validate validates this response meta +func (m *ResponseMeta) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this response meta based on context it is used +func (m *ResponseMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ResponseMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ResponseMeta) UnmarshalBinary(b []byte) error { + var res ResponseMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/app/address.go b/app/address.go new file mode 100644 index 0000000..448b11d --- /dev/null +++ b/app/address.go @@ -0,0 +1,20 @@ +package app + +// Address address struct +type Address struct { + City string + Country string + CountryCode string + PostalCode string + State string + StateCode string + Street string +} + +// ToString returns the full address in a string +func (obj *Address) ToString() string { + return obj.Street + " " + + obj.City + " " + + obj.State + " " + + obj.PostalCode +} diff --git a/app/auth.go b/app/auth.go new file mode 100644 index 0000000..0b17dbf --- /dev/null +++ b/app/auth.go @@ -0,0 +1,39 @@ +package app + +import ( + "code.tnxs.net/telnexus/lib/api/auth/auth_client/user" + "code.tnxs.net/telnexus/lib/api/auth/auth_models" + httptransport "github.com/go-openapi/runtime/client" +) + +// CheckAPIUser authenticates a User with the auth service +// +// When called, ChechAPIUser assumes there is an "auth" service account in the +// app configuration file. +// +func CheckAPIUser(token *string) (*User, error) { + sugar.Debug("app.CheckAPIUser: 📥") + if authUser == nil { + authUser = &User{ + APIKey: GetServiceAccount("auth").APIKey, + Auth: httptransport.APIKeyAuth( + "X-API-Key", + "header", + GetServiceAccount("auth").APIKey, + ), + } + } + params := user.NewGetUsersParams() + params.Apikey = token + response, err := authClient.User.GetUsers(params, authUser.Auth) + if err != nil { + sugar.Warnf("app.CheckAPIUser: ❗ Access attempt with invalid API key: %s", *token) + return nil, err + } + var obj *auth_models.User + for _, itm := range response.Payload.Data { // single iteration execution + obj = itm + } + sugar.Debugf("app.CheckAPIUser: 📤 👍 ID = %s, Name = %s", obj.ID, obj.Name) + return MarshalAuthUserToSwagger(obj), nil +} diff --git a/app/config.go b/app/config.go new file mode 100644 index 0000000..5e5c7bf --- /dev/null +++ b/app/config.go @@ -0,0 +1,217 @@ +package app + +import ( + "time" + + "code.tnxs.net/telnexus/lib/app/logger" + "go.uber.org/zap/zapcore" +) + +// Worker describes how many service workers to launch +type Worker struct { + ChannelSize int64 `mapstructure:"channel_size,omitempty"` + WorkerCount int `mapstructure:"worker_count,omitempty"` +} + +// CacheSize describes how to chunkify resources +type CacheSize struct { + Increment int64 +} + +// Metrics defines the if and where to collect data +type Metrics struct { + Address string `mapstructure:"address,omitempty"` + Enabled bool `mapstructure:"enabled,omitempty"` +} + +// Endpoint describes a web URL as a service endpoint +type Endpoint struct { + BasePath string `mapstructure:"base_path,omitempty"` + Host string `mapstructure:"host,omitempty"` + Scheme string `mapstructure:"scheme,omitempty"` +} + +// Chunk defines cache chunk size +type Chunk struct { + size int32 `mapstructure:"size,omitempty"` +} + +// ServiceAccount defines and external service +type ServiceAccount struct { + APIKey string `mapstructure:"api_key,omitempty"` + ApplicationName string `mapstructure:"application_name,omitempty"` + AuthenticationType string `mapstructure:"authentication_type,omitempty"` + BackendID string `mapstructure:"backend_id,omitempty"` + ClientID string `mapstructure:"client_id,omitempty"` + ClientSecret string `mapstructure:"client_secret,omitempty"` + DSN string `mapstructure:"dsn,omitempty"` + Endpoint Endpoint `mapstructure:"endpoint,omitempty"` + Password string `mapstructure:"password,omitempty"` + Production bool `mapstructure:"production,omitempty"` + SecurityToken string `mapstructure:"security_token,omitempty"` + Credentials string `mapstructure:"credentials,omitempty"` + Timeout time.Duration `mapstructure:"timeout,omitempty"` + Type string `mapstructure:"type,omitempty"` + Username string `mapstructure:"username,omitempty"` + Vendor string `mapstructure:"vendor,omitempty"` +} + +// Configuration defines the config struct +type Configuration struct { + AppName string `mapstructure:"app_name,omitempty"` + BackendID string `mapstructure:"backend_id,omitempty"` + BuildEnv string `mapstructure:"build_env,omitempty"` + CacheSizes map[string]CacheSize `mapstructure:"cache_sizes,omitempty"` + ClusterID string `mapstructure:"cluster_id,omitempty"` + Chunks map[string]Chunk `mapstructure:"chunks,omitempty"` + DBMS string `mapstructure:"dbms,omitempty"` + DBMSHost string `mapstructure:"dbms_host,omitempty"` + DBMSName string `mapstructure:"dbms_name,omitempty"` + DBMSPassword string `mapstructure:"dbms_password,omitempty"` + DBMSUsername string `mapstructure:"dbms_username,omitempty"` + DSN string `mapstructure:"dsn,omitempty"` + Endpoint Endpoint `mapstructure:"endpoint,omitempty"` + Environment string `mapstructure:"environment,omitempty"` + GelfURI string `mapstructure:"gelf_uri,omitempty"` + GitHubOrgName string `mapstructure:"git_hub_org_name,omitempty"` + LogLevel int `mapstructure:"log_level,omitempty"` + Metrics Metrics `mapstructure:"metrics,omitempty"` + KafkaServer string `mapstructure:"kafka_server,omitempty"` + PDFRenderEngine string `mapstructure:"pdf_render_engine,omitempty"` + RegistryPriv string `mapstructure:"registry_priv,omitempty"` + RegistryPublic string `mapstructure:"registry_public,omitempty"` + RepoName string `mapstructure:"repo_name,omitempty"` + ServiceAccounts map[string]ServiceAccount `mapstructure:"service_accounts,omitempty"` + ShutdownTimeout time.Duration `mapstructure:"shutdown_timeout,omitempty"` + Version string `mapstructure:"version,omitempty"` + Workers map[string]Worker `mapstructure:"workers,omitempty"` +} + +// GetCacheSize returns the named cache size +func GetCacheSize(name string) int64 { + obj, ok := config.CacheSizes[name] + if ok { + return obj.Increment + } + sugar.Warnf("app.GetCacheSize: unknown cache size identifier: %s", name) + return 0 +} + +// GetPDFRenderEngine returns a config file parameter +func GetPDFRenderEngine() string { + return config.PDFRenderEngine +} + +// GetKafkaServer returns a config file parameter +func GetKafkaServer() string { + if config.KafkaServer != "" { + return config.KafkaServer + } + return "nats.fabric.tnxs.net" +} + +// GetChunkSize returns a config file parameter +func GetChunkSize(chunkName string) int { + obj, ok := config.Chunks[chunkName] + if ok { + return int(obj.size) + } + return 0 +} + +// GetMetricsAddress return the metrics Address value +func GetMetricsAddress() string { + return config.Metrics.Address +} + +// IsMetrics returns TRUE if metrics enabled +func IsMetrics() bool { + return config.Metrics.Enabled +} + +// GetWorker returns the named worker record +func GetWorker(name string) *Worker { + worker, ok := config.Workers[name] + if ok { + return &worker + } + return nil +} + +// GetServiceAccount returns the named service account struct +func GetServiceAccount(name string) *ServiceAccount { + serviceaccount, ok := config.ServiceAccounts[name] + if ok { + return &serviceaccount + } + sugar.Errorf("app.config: 💣⛔ unknown service account: %s", name) + return nil +} + +// GetDBMSHost returns the parameter +func GetDBMSHost() string { + return config.DBMSHost +} + +// GetDBMSName returns the parameter +func GetDBMSName() string { + return config.DBMSName +} + +// GetDBMSPassword returns the parameter +func GetDBMSPassword() string { + return config.DBMSPassword +} + +// GetDBMSUsername returns the parameter +func GetDBMSUsername() string { + return config.DBMSUsername +} + +// GetAppName retrieves the Taxnexus App Name for this microservice +func GetAppName() string { + return config.AppName +} + +// GetEnvironment retrieves the current runtime environment +func GetEnvironment() string { + return config.Environment +} + +// GetBackendID retrieves the backend ID +func GetBackendID() string { + return config.BackendID +} + +// GetClusterID retrieves the cluster ID +func GetClusterID() string { + return config.ClusterID +} + +// GetDSN retrieves the Taxnexus database DSN for this microservice +func GetDSN() string { + return config.DSN +} + +// GetDBMS retrieves the DBMS string +func GetDBMS() string { + return config.DBMS +} + +// GetLogLevel returns the Log Level +func GetLogLevel() zapcore.Level { + switch config.LogLevel { + case int(logger.DebugLevel): + return logger.DebugLevel + case int(logger.InfoLevel): + return logger.InfoLevel + case int(logger.WarnLevel): + return logger.WarnLevel + case int(logger.ErrorLevel): + return logger.ErrorLevel + case int(logger.PanicLevel): + return logger.PanicLevel + default: + return logger.DebugLevel + } +} diff --git a/app/force.go b/app/force.go new file mode 100644 index 0000000..521af2b --- /dev/null +++ b/app/force.go @@ -0,0 +1,26 @@ +package app + +import ( + "github.com/taxnexus/go-force/force" +) + +// InitForce creates a salesforce connection using serviceAccountName +func InitForce(serviceAccountName string) *force.API { + sugar.Infof("app.initForce: 📥 %s", serviceAccountName) + acct := GetServiceAccount(serviceAccountName) + theForce, err := force.Create( + "v45.0", + acct.ClientID, + acct.ClientSecret, + acct.Username, + acct.Password, + acct.SecurityToken, + "production", + ) + if err != nil { + sugar.Errorf("app.InitForce: salesforce error: %s", err.Error()) + return nil + } + sugar.Info("app.InitForce: 👍 📤") + return theForce +} diff --git a/app/logger/logger.go b/app/logger/logger.go new file mode 100644 index 0000000..7e5fb5f --- /dev/null +++ b/app/logger/logger.go @@ -0,0 +1,43 @@ +// Package logger wraps an external logging package +package logger + +import ( + "log" + + "go.uber.org/zap" + "go.uber.org/zap/zapcore" +) + +type logger = zap.SugaredLogger + +// DebugLevel is exported (5) +var DebugLevel = zapcore.DebugLevel + +// InfoLevel is exported (4) +var InfoLevel = zapcore.InfoLevel + +// WarnLevel is exported (3) +var WarnLevel = zapcore.WarnLevel + +// ErrorLevel is exported (2) +var ErrorLevel = zapcore.ErrorLevel + +// PanicLevel is exported (1) +var PanicLevel = zapcore.PanicLevel + +// New creates a new logger and returns it +func New(level zapcore.Level) *logger { + var theLogger *zap.Logger + var err error + if level == zapcore.DebugLevel { + theLogger, err = zap.NewDevelopment() + } else { + theLogger, err = zap.NewProduction() + } + if err != nil { + log.Fatal("logger.New: 💣 ⛔ zap logger init fail") + } + // theLogger.SetLevel + defer theLogger.Sync() //nolint:errcheck // it's defered + return theLogger.Sugar() +} diff --git a/app/mysql.go b/app/mysql.go new file mode 100644 index 0000000..36db634 --- /dev/null +++ b/app/mysql.go @@ -0,0 +1,29 @@ +package app + +import ( + "database/sql" + + // need this for SQL + _ "github.com/go-sql-driver/mysql" +) + +// MyDB is the MySQL handler variable +var MyDB *sql.DB + +// InitDB initializes the MySQL database using DSN information from the config file +// +func InitDB() { + var db *sql.DB + var err error + if GetDBMS() != "mysql" { + sugar.Fatalf("app.InitDB: 💣 ⛔ unknown DBMS: %s", GetDBMS()) + return + } + db, err = sql.Open("mysql", GetDSN()) + if err != nil { + sugar.Fatalf("app.InitDB: 💣 ⛔ Can't log on to DBMS host: %w", err) + return + } + MyDB = db + sugar.Debugf("app.InitDB: 👍 📤 %s", GetDBMS()) +} diff --git a/app/prometheus.go b/app/prometheus.go new file mode 100644 index 0000000..ed6f341 --- /dev/null +++ b/app/prometheus.go @@ -0,0 +1,67 @@ +package app + +import ( + "fmt" + "net/http" + "time" + + "github.com/prometheus/client_golang/prometheus" + "github.com/rs/cors" +) + +var ( + namespace = "collage" + + counter = prometheus.NewCounterVec(prometheus.CounterOpts{ + Namespace: namespace, + Name: "endpoint_request_count", + Help: "collage request count.", + }, []string{"app", "name", "method", "state"}) + + histogram = prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Namespace: namespace, + Name: "endpoint_duration_seconds", + Help: "Time taken to execute endpoint.", + }, []string{"app", "name", "method", "status"}) +) + +type metricResponseWriter struct { + http.ResponseWriter + statusCode int +} + +func newMetricResponseWriter(w http.ResponseWriter) *metricResponseWriter { + return &metricResponseWriter{w, http.StatusOK} +} + +func (lrw *metricResponseWriter) WriteHeader(code int) { + lrw.statusCode = code + lrw.ResponseWriter.WriteHeader(code) +} + +// SetupPrometheusHandler enable CORS, handler metrics +func SetupPrometheusHandler(handler http.Handler, app string) http.Handler { + sugar.Debug("app.SetupPrometheusHandler: 📥") + handleCORS := cors.AllowAll().Handler + h := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + start := time.Now() + lrw := newMetricResponseWriter(w) + handler.ServeHTTP(lrw, r) + statusCode := lrw.statusCode + duration := time.Since(start) + histogram.WithLabelValues(app, r.URL.String(), r.Method, fmt.Sprintf("%d", statusCode)).Observe(duration.Seconds()) + counter.WithLabelValues(app, r.URL.String(), r.Method, fmt.Sprintf("%d", statusCode)).Inc() + }) + err := prometheus.Register(histogram) + if err != nil { + sugar.Errorf("app.SetupPrometheusHandler: 💣 ⛔ %s", err.Error()) + return nil + } + err = prometheus.Register(counter) + if err != nil { + sugar.Errorf("app.SetupPrometheusHandler: 💣 ⛔ %s", err.Error()) + return nil + } + sugar.Info("app.SetupPrometheusHandler: 👍 📤") + return handleCORS(h) +} diff --git a/app/root.go b/app/root.go new file mode 100644 index 0000000..88bb269 --- /dev/null +++ b/app/root.go @@ -0,0 +1,50 @@ +// Package app is a utility package +package app + +import ( + "strings" + + "code.tnxs.net/telnexus/lib/api/auth/auth_client" + "code.tnxs.net/telnexus/lib/app/logger" + "github.com/spf13/viper" + "github.com/taxnexus/go-force/force" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" +) + +// const dateTimeFormat = "2006-01-02T15:04:05-0800" +var sugar *zap.SugaredLogger +var config = Configuration{} +var appViper = viper.New() +var configured = false +var authClient = auth_client.Default +var authUser *User + +// TheForce exports the salesforce interface +var TheForce *force.API + +// InitConfig exports the config initialization func +func InitConfig(systemName string, initalLogLevel zapcore.Level) { + if configured { + return + } + sugar = logger.New(initalLogLevel) + sugar.Infof("app.InitConfig: 📥 %s", systemName) + appViper.SetConfigType("yaml") + appViper.SetConfigName(systemName) + appViper.AddConfigPath("/etc/telnexus") + appViper.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) + appViper.SetEnvPrefix("telnexus") + appViper.AutomaticEnv() // read in environment variables that match + err := appViper.ReadInConfig() + if err != nil { + sugar.Fatalf("app.InitConfig: 💣 ⛔ can't read system config: %w", err) + } + err = appViper.Unmarshal(&config) + if err != nil { + sugar.Fatalf("app.InitConfig: 💣 ⛔ can't unmarshal system config: %w", err) + } + sugar = logger.New(GetLogLevel()) + sugar.Debugf("app.InitConfig: 👍 📤 serviceAccounts: %d", len(config.ServiceAccounts)) + configured = true +} diff --git a/app/tenantuser.go b/app/tenantuser.go new file mode 100644 index 0000000..d03390a --- /dev/null +++ b/app/tenantuser.go @@ -0,0 +1,31 @@ +package app + +import "code.tnxs.net/telnexus/lib/api/devops/devops_models" + +// TenantUserActivityWrapper wraps the object with workflow params +type TenantUserActivityWrapper struct { + Obj devops_models.TenantUser + APIKey string + SagaID string + SagaType string +} + +// TenantUser is a first class object type +type TenantUser struct { + AccessLevel string + AccountID string + Auth0UserID string + CompanyName string + ContactID string + TelnexusAccount string + TenantActive bool + TenantID string + TenantName string + TenantStatus string + TenantType string + TenantVersion string + UserEmail string + UserFullName string + UserID string + Username string +} diff --git a/app/user-helpers.go b/app/user-helpers.go new file mode 100644 index 0000000..7aec588 --- /dev/null +++ b/app/user-helpers.go @@ -0,0 +1,134 @@ +package app + +import ( + "code.tnxs.net/telnexus/lib/api/auth/auth_models" + httptransport "github.com/go-openapi/runtime/client" +) + +// MarshalAuthUserToSwagger is a helper function +func MarshalAuthUserToSwagger(obj *auth_models.User) *User { + var address *Address + if obj.Address != nil { + address = &Address{ + City: obj.Address.City, + Country: obj.Address.Country, + CountryCode: obj.Address.CountryCode, + PostalCode: obj.Address.PostalCode, + State: obj.Address.State, + StateCode: obj.Address.StateCode, + Street: obj.Address.Street, + } + } + var userRoles []*UserRole + if obj.UserRoles != nil { + userRoles = []*UserRole{} + for _, itm := range obj.UserRoles { + userRoles = append(userRoles, reMarshalUserRole(itm)) + } + } + var tenantUsers []*TenantUser + if obj.TenantUsers != nil { + tenantUsers = []*TenantUser{} + for _, itm := range obj.TenantUsers { + tenantUsers = append(tenantUsers, reMarshalTenantUser(itm)) + } + } + return &User{ + ID: obj.ID, + AboutMe: obj.AboutMe, + AccountID: obj.AccountID, + Address: address, + Alias: obj.Alias, + APIKey: obj.APIKey, + Auth: httptransport.APIKeyAuth("X-API-Key", "header", obj.APIKey), + Auth0UserID: obj.Auth0UserID, + CommunityNickname: obj.CommunityNickname, + CompanyName: obj.CompanyName, + ContactID: obj.ContactID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate, + DelegatedApproverID: obj.DelegatedApproverID, + Department: obj.Department, + Division: obj.Division, + Email: obj.Email, + EmployeeNumber: obj.EmployeeNumber, + EndOfDay: obj.EndOfDay, + Environment: obj.Environment, + Extension: obj.Extension, + FabricAPIKey: obj.FabricAPIKey, + Fax: obj.Fax, + FirstName: obj.FirstName, + ForecastEnabled: obj.ForecastEnabled, + FullPhotoURL: obj.FullPhotoURL, + IsActive: obj.IsActive, + IsPortalEnabled: obj.IsPortalEnabled, + IsProfilePhotoActive: obj.IsProphilePhotoActive, + IsSystemControlled: obj.IsSystemControlled, + LastIP: obj.LastIP, + LastLogin: obj.LastLogin, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate, + LastName: obj.LastName, + LoginCount: obj.LoginCount, + ManagerID: obj.ManagerID, + MobilePhone: obj.MobilePhone, + Name: obj.Name, + OutOfOfficeMessage: obj.OutOfOfficeMessage, + Phone: obj.Phone, + PortalRole: obj.PortalRole, + ProfileID: obj.ProfileID, + ReceivesAdminEmails: obj.ReceivesAdminEmails, + ReceivesAdminInfoEmails: obj.ReceivesAdminInfoEmails, + SenderEmail: obj.SenderEmail, + SenderName: obj.SenderName, + Signature: obj.Signature, + SmallPhotoURL: obj.SmallPhotoURL, + StartOfDay: obj.StartOfDay, + TaxnexusAccount: obj.TelnexusAccount, + TenantID: obj.TenantID, + TenantUsers: tenantUsers, + TimeZone: obj.TimeZone, + Title: obj.Title, + Username: obj.Username, + UserRoleID: obj.UserRoleID, + UserRoles: userRoles, + UserType: obj.UserType, + } +} +func reMarshalUserRole(s *auth_models.UserRole) *UserRole { + return &UserRole{ + AccountID: s.AccountID, + Auth0RoleID: s.Auth0RoleID, + Auth0UserID: s.Auth0UserID, + CompanyName: s.CompanyName, + ContactID: s.ContactID, + RoleDescription: s.RoleDescription, + RoleID: s.RoleID, + RoleName: s.RoleName, + TelnexusAccount: s.TelnexusAccount, + UserEmail: s.UserEmail, + UserFullName: s.UserFullName, + UserID: s.UserID, + Username: s.Username, + } +} +func reMarshalTenantUser(s *auth_models.TenantUser) *TenantUser { + return &TenantUser{ + AccessLevel: s.AccessLevel, + AccountID: s.AccountID, + Auth0UserID: s.Auth0UserID, + CompanyName: s.CompanyName, + ContactID: s.ContactID, + TelnexusAccount: s.TelnexusAccount, + TenantActive: s.TenantActive, + TenantID: s.TenantID, + TenantName: s.TenantName, + TenantStatus: s.TenantStatus, + TenantType: s.TenantType, + TenantVersion: s.TenantVersion, + UserEmail: s.UserEmail, + UserFullName: s.UserFullName, + UserID: s.UserID, + Username: s.Username, + } +} diff --git a/app/user.go b/app/user.go new file mode 100644 index 0000000..4acebb8 --- /dev/null +++ b/app/user.go @@ -0,0 +1,78 @@ +package app + +import ( + "code.tnxs.net/telnexus/lib/api/devops/devops_models" + "github.com/go-openapi/runtime" +) + +// UserActivityWrapper wraps the object with workflow params +type UserActivityWrapper struct { + Obj devops_models.User + APIKey string + SagaID string + SagaType string +} + +// User is a first class object type +type User struct { + ID string + AboutMe string + AccountID string + Address *Address + Alias string + APIKey string + Auth runtime.ClientAuthInfoWriter + Auth0UserID string + CommunityNickname string + CompanyName string + ContactID string + CreatedByID string + CreatedDate string + DelegatedApproverID string + Department string + Division string + Email string + EmployeeNumber string + EndOfDay string + Environment string + Extension string + FabricAPIKey string + Fax string + FirstName string + ForecastEnabled bool + FullPhotoURL string + IsActive bool + IsPortalEnabled bool + IsProfilePhotoActive bool + IsSystemControlled bool + LastIP string + LastLogin string + LastModifiedByID string + LastModifiedDate string + LastName string + LoginCount int64 + ManagerID string + MobilePhone string + Name string + OutOfOfficeMessage string + Phone string + PortalRole string + ProfileID string + ReceivesAdminEmails bool + ReceivesAdminInfoEmails bool + ReceivesInfoEmails bool + SenderEmail string + SenderName string + Signature string + SmallPhotoURL string + StartOfDay string + TaxnexusAccount string + TenantID string + TenantUsers []*TenantUser + TimeZone string + Title string + Username string + UserRoles []*UserRole + UserRoleID string + UserType string +} diff --git a/app/userrole.go b/app/userrole.go new file mode 100644 index 0000000..2a002da --- /dev/null +++ b/app/userrole.go @@ -0,0 +1,28 @@ +package app + +import "code.tnxs.net/telnexus/lib/api/devops/devops_models" + +// UserRoleActivityWrapper wraps the object with workflow params +type UserRoleActivityWrapper struct { + Obj devops_models.UserRole + APIKey string + SagaID string + SagaType string +} + +// UserRole is a first class object type +type UserRole struct { + RoleID string + UserID string + Auth0RoleID string + RoleDescription string + RoleName string + AccountID string + CompanyName string + ContactID string + UserEmail string + UserFullName string + TelnexusAccount string + Username string + Auth0UserID string +} diff --git a/build/COPYRIGHT b/build/COPYRIGHT new file mode 100644 index 0000000..09cf3a9 --- /dev/null +++ b/build/COPYRIGHT @@ -0,0 +1,3 @@ +(c) 2012-2020 by Telnexus LLC +All rights reserved worldwide. +Proprietary product; unlicensed use is not allowed \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..693b761 --- /dev/null +++ b/go.mod @@ -0,0 +1,17 @@ +module code.tnxs.net/telnexus/lib + +go 1.15 + +require ( + github.com/go-openapi/errors v0.19.6 + github.com/go-openapi/runtime v0.19.26 + github.com/go-openapi/strfmt v0.19.5 + github.com/go-openapi/swag v0.19.9 + github.com/go-openapi/validate v0.19.10 + github.com/go-sql-driver/mysql v1.4.0 + github.com/prometheus/client_golang v1.9.0 + github.com/rs/cors v1.7.0 + github.com/spf13/viper v1.7.1 + github.com/taxnexus/go-force v1.0.7 + go.uber.org/zap v1.16.0 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..11f4b2e --- /dev/null +++ b/go.sum @@ -0,0 +1,723 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= +github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= +github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 h1:4daAzAu0S6Vi7/lbWECcX0j45yZReDZ56BQsrVBOEEY= +github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= +github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= +github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= +github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= +github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= +github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= +github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= +github.com/go-openapi/analysis v0.19.4/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= +github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= +github.com/go-openapi/analysis v0.19.10 h1:5BHISBAXOc/aJK25irLZnx2D3s6WyYaY9D4gmuz9fdE= +github.com/go-openapi/analysis v0.19.10/go.mod h1:qmhS3VNFxBlquFJ0RGoDtylO9y4pgTAUNE9AEEMdlJQ= +github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= +github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= +github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= +github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= +github.com/go-openapi/errors v0.19.6 h1:xZMThgv5SQ7SMbWtKFkCf9bBdvR2iEyw9k3zGZONuys= +github.com/go-openapi/errors v0.19.6/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= +github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= +github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= +github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI= +github.com/go-openapi/loads v0.19.5 h1:jZVYWawIQiA1NBnHla28ktg6hrcfTHsCE+3QLVRBIls= +github.com/go-openapi/loads v0.19.5/go.mod h1:dswLCAdonkRufe/gSUC3gN8nTSaB9uaS2es0x5/IbjY= +github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= +github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= +github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= +github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= +github.com/go-openapi/runtime v0.19.26 h1:K/6PoVNj5WJXUnMk+VEbELeXjtBkCS1UxTDa04tdXE0= +github.com/go-openapi/runtime v0.19.26/go.mod h1:BvrQtn6iVb2QmiVXRsFAm6ZCAZBpbVKFfN6QWCp582M= +github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= +github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= +github.com/go-openapi/spec v0.19.6/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= +github.com/go-openapi/spec v0.19.8 h1:qAdZLh1r6QF/hI/gTq+TJTvsQUodZsM7KLqkAJdiJNg= +github.com/go-openapi/spec v0.19.8/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= +github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= +github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= +github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= +github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= +github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= +github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= +github.com/go-openapi/strfmt v0.19.5 h1:0utjKrw+BAh8s57XE9Xz8DUBsVvPmRUB6styvl9wWIM= +github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= +github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= +github.com/go-openapi/swag v0.19.9 h1:1IxuqvBUU3S2Bi4YC7tlP9SJF1gVpCvqN0T2Qof4azE= +github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= +github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= +github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= +github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= +github.com/go-openapi/validate v0.19.10 h1:tG3SZ5DC5KF4cyt7nqLVcQXGj5A7mpaYkAcNPlDK+Yk= +github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbNMAuKvKB+IaGx8= +github.com/go-sql-driver/mysql v1.4.0 h1:7LxgVwFb2hIQtMm87NdgAVfXjnt4OePseqT1tKx+opk= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= +github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= +github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= +github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= +github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= +github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= +github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= +github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= +github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= +github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= +github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= +github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= +github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= +github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= +github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= +github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= +github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= +github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= +github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= +github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= +github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= +github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.1 h1:mdxE1MF9o53iCb2Ghj1VfWvh7ZOwHpnVG/xwXrV90U8= +github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= +github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.3.2 h1:mRS76wmkOn3KkKAyXDu42V+6ebnXWIztFSYGN7GeoRg= +github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= +github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= +github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= +github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= +github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.4.0 h1:u3Z1r+oOXJIkxqw34zVhyPgjBsm6X2wn21NWs/HfSeg= +github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= +github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.9.0 h1:Rrch9mh17XcxvEu9D9DEpb4isxjGBtcevQjKvxPRQIU= +github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.15.0 h1:4fgOnadei3EZvgRwxJ7RMpG1k1pOZth5Pc13tyspaKM= +github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4= +github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= +github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= +github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/taxnexus/go-force v1.0.7 h1:AhfmLToq3XIq5SkaC621uPu9kGjyTxwDi2k5XxuWws0= +github.com/taxnexus/go-force v1.0.7/go.mod h1:lJDnynWzSMNjYWpPzAMX4gGy+nwDxBFgdHd4z0U1BG0= +github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= +github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= +go.mongodb.org/mongo-driver v1.3.4 h1:zs/dKNwX0gYUtzwrN9lLiR15hCO0nDwQj5xXx+vjCdE= +go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM= +go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e h1:AyodaIpKjppX+cBfTASF2E1US3H2JFBj920Ot3rtDjs= +golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114 h1:DnSr2mCsxyCE6ZgIkmcWUQY2R5cH/6wL7eIxEmQOMSE= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= +gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= +gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/swagger/auth-telnexus.yaml b/swagger/auth-telnexus.yaml new file mode 100644 index 0000000..c5f84c4 --- /dev/null +++ b/swagger/auth-telnexus.yaml @@ -0,0 +1,435 @@ +swagger: "2.0" +info: + version: 0.0.2 + title: "auth" + description: "Authentication Microservice" + termsOfService: "http://telnexus.com/terms/" + contact: + email: "noc@telnexus.com" + license: + name: "Proprietary - Copyright (c) 2018-2020 by Telnexus LLC" +securityDefinitions: + ApiKeyAuth: + type: "apiKey" + in: "header" + name: "X-API-Key" +security: + - ApiKeyAuth: [] +schemes: + - "http" +basePath: "/v1" +host: "auth.infra.tnxs.net:8080" +consumes: + - "application/json" +produces: + - "application/json" +parameters: + apiKeyQuery: + description: Service account or developer API key + in: query + name: apikey + type: string +responses: + AccessForbidden: + description: "Access forbidden, account lacks access" + schema: + $ref: "#/definitions/Error" + NotFound: + description: Resource was not found + schema: + $ref: "#/definitions/Error" + ServerError: + description: Server Internal Error + schema: + $ref: "#/definitions/Error" + Unauthorized: + description: "Access Unauthorized, invalid API-KEY was used" + schema: + $ref: "#/definitions/Error" + UnprocessableEntity: + description: "Unprocessable Entity, likely a bad parameter" + schema: + $ref: "#/definitions/Error" + UserResponse: + description: Telnexus Response with User objects + schema: + $ref: "#/definitions/UserResponse" +paths: + /users: + get: + summary: "Check API Key" + operationId: "getUsers" + description: + "Checks for a valid API key, and returns full user record" + parameters: + - $ref: "#/parameters/apiKeyQuery" + tags: + - "User" + responses: + "200": + $ref: "#/responses/UserResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" +definitions: + Address: + properties: + City: + description: City + type: string + Country: + description: Country full name + type: string + CountryCode: + description: Country Code + type: string + PostalCode: + description: Postal Code + type: string + State: + description: State full name + type: string + StateCode: + description: State Code + type: string + Street: + description: Street number and name + type: string + type: object + Error: + properties: + Code: + format: int32 + type: integer + Fields: + type: string + Message: + type: string + type: object + ResponseMeta: + properties: + Contact: + description: Microservice Contact Info + type: string + Copyright: + description: Copyright Info + type: string + License: + description: License Information and Restrictions + type: string + OperationID: + description: Operation ID + type: string + RequestIP: + description: Request IP Address + type: string + RequestType: + description: Request Type + type: string + RequestURL: + description: Request URL + type: string + ServerInfo: + description: Data Server Info + type: string + ServerResponseTime: + description: Data Server Response Time (ms) + type: string + ServerTimestamp: + description: Backend Server Timestamp + type: string + TelnexusAccount: + description: + Telnexus Account Number used for recording transactions + type: string + type: object + User: + properties: + AboutMe: + description: About Me + type: string + AccountID: + description: Account ID + type: string + Address: + $ref: "#/definitions/Address" + Alias: + description: Alias + type: string + APIKey: + description: API Key + type: string + Auth0UserID: + description: Auth0 User Id + type: string + CommunityNickname: + description: Nickname + type: string + CompanyName: + description: Company Name + type: string + ContactID: + description: Contact + type: string + CreatedByID: + description: Created User ID + type: string + CreatedDate: + description: Date Created + type: string + DelegatedApproverID: + description: Delegated Approver + type: string + Department: + description: Department + type: string + Division: + description: Division + type: string + Email: + description: Email address + type: string + EmployeeNumber: + description: Employee Number + type: string + EndOfDay: + description: Time day ends + type: string + Environment: + description: Environment + type: string + Extension: + description: Extension + type: string + FabricAPIKey: + description: Fabric API Key + type: string + Fax: + description: Fax + type: string + FirstName: + description: The first name + type: string + ForecastEnabled: + description: Allow Forecasting + type: boolean + FullPhotoURL: + description: Full Photo URL + type: string + ID: + description: Telnexus ID + type: string + IsActive: + description: Active + type: boolean + IsPortalEnabled: + description: Is the user enabled for Communities? + type: boolean + IsProphilePhotoActive: + description: Has Profile Photo + type: boolean + IsSystemControlled: + type: boolean + LastModifiedByID: + description: Last Modified User ID + type: string + LastModifiedDate: + description: Last Modified Date + type: string + LastLogin: + description: Last login time + type: string + LastIP: + description: IP address of last login + type: string + LoginCount: + description: Number of times user has logged in + type: number + format: int64 + LastName: + description: The Last Name + type: string + ManagerID: + description: Manager + type: string + MobilePhone: + description: Mobile + type: string + Name: + description: Name + type: string + OutOfOfficeMessage: + description: Out of office message + type: string + Phone: + description: Phone + type: string + PortalRole: + description: Portal Role Level + type: string + ProfileID: + description: Profile + type: string + ReceivesAdminInfoEmails: + description: Admin Info Emails + type: boolean + ReceivesAdminEmails: + description: Info Emails + type: boolean + SenderEmail: + description: Email Sender Address + type: string + SenderName: + description: Email Sender Name + type: string + Signature: + description: Email Signature + type: string + SmallPhotoURL: + description: Small Photo URL + type: string + StartOfDay: + description: The time day starts + type: string + TelnexusAccount: + description: Telnexus Account + type: string + TenantID: + description: Tenant ID associated with this user + type: string + TimeZone: + description: Time Zone + type: string + Title: + description: Title + type: string + Username: + description: Username + type: string + UserRoleID: + description: Role + type: string + UserType: + description: User Type + type: string + UserRoles: + items: + $ref: "#/definitions/UserRole" + type: array + TenantUsers: + items: + $ref: "#/definitions/TenantUser" + type: array + type: object + UserResponse: + description: An array Telnexus user objects + properties: + Data: + items: + $ref: "#/definitions/User" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + UserRole: + description: Relationship object that connects user to a role + type: object + properties: + AccountID: + description: Account Id + type: string + Auth0RoleID: + description: Linked role ID + type: string + Auth0UserID: + description: Auth0 User ID + type: string + CompanyName: + description: Company Name + type: string + ContactID: + description: Contact ID + type: string + RoleDescription: + description: Role description + type: string + RoleID: + description: The Role ID + type: string + RoleName: + description: Role Name + type: string + TelnexusAccount: + description: Telnexus Account Number + type: string + UserEmail: + description: User Email Address + type: string + UserFullName: + description: User Full Name + type: string + UserID: + description: The User ID + type: string + Username: + description: Username + type: string + TenantUser: + description: Relationship object that connects users to a tenant + type: object + properties: + AccessLevel: + description: The makeTenantUser access level for this User + type: string + Auth0UserID: + description: Auth0 User ID + type: string + AccountID: + description: Account ID + type: string + ContactID: + description: Contact ID + type: string + CompanyName: + description: Account Name + type: string + TelnexusAccount: + description: Telnexus Account + type: string + TenantActive: + description: Tenant active? + type: boolean + TenantID: + description: The Tenant ID + type: string + TenantName: + description: Tenant Name + type: string + TenantStatus: + description: Tenant Status + type: string + TenantType: + description: Tenant type + type: string + TenantVersion: + description: Tenant Version + type: string + Username: + description: Username + type: string + UserEmail: + description: User Email Address + type: string + UserFullName: + description: User Full Name + type: string + UserID: + description: The User ID + type: string diff --git a/swagger/cloud-telnexus.yaml b/swagger/cloud-telnexus.yaml new file mode 100644 index 0000000..8a08327 --- /dev/null +++ b/swagger/cloud-telnexus.yaml @@ -0,0 +1,699 @@ +swagger: "2.0" +info: + version: 0.0.2 + title: "cloud" + description: "Cloud Gateway Microservice" + termsOfService: "http://telnexus.com/terms/" + contact: + email: "noc@telnexus.com" + license: + name: "Proprietary - Copyright (c) 2018-2020 by Telnexus LLC." +securityDefinitions: + ApiKeyAuth: + type: "apiKey" + in: "header" + name: "X-API-Key" +security: + - ApiKeyAuth: [] +schemes: + - "http" +basePath: "/v1" +host: "cloud.infra.tnxs.net:8080" +consumes: + - "application/json" +produces: + - "application/json" +parameters: + apiKeyQuery: + description: Service account or developer API key + in: query + name: apikey + type: string + hubRequest: + description: An array of new Hub records + in: body + name: hubRequest + required: true + schema: + $ref: "#/definitions/HubRequest" + limitQuery: + description: "How many objects to return at one time" + format: int64 + in: query + name: limit + required: false + type: integer + accountIdQuery: + description: Taxnexus Record Id of an Account + in: query + name: accountId + required: false + type: string + nameQuery: + description: The Name of this Object + in: query + name: name + required: false + type: string + offsetQuery: + description: How many objects to skip? (default 0) + format: int64 + in: query + name: offset + required: false + type: integer + activeQuery: + description: Retrieve active records? + in: query + name: active + required: false + type: boolean + emailQuery: + description: Email address? + in: query + name: email + required: false + type: string +responses: + AccessForbidden: + description: "Access forbidden, account lacks access" + schema: + $ref: "#/definitions/Error" + NotFound: + description: Resource was not found + schema: + $ref: "#/definitions/Error" + ServerError: + description: Server Internal Error + schema: + $ref: "#/definitions/Error" + Unauthorized: + description: "Access Unauthorized, invalid API-KEY was used" + schema: + $ref: "#/definitions/Error" + UnprocessableEntity: + description: "Unprocessable Entity, likely a bad parameter" + schema: + $ref: "#/definitions/Error" + UserResponse: + description: Taxnexus Response with User objects + schema: + $ref: "#/definitions/UserResponse" + HubResponse: + description: Telnexus Response with Hub objects + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + $ref: "#/definitions/HubResponse" + DeleteResponse: + description: + Taxnexus Response with Message Objects with Delete Status + headers: + Access-Control-Allow-Origin: + type: string + schema: + $ref: "#/definitions/DeleteResponse" + CORSResponse: + description: CORS OPTIONS response + headers: + Access-Control-Allow-Origin: + type: string + Access-Control-Allow-Headers: + type: string + Access-Control-Allow-Methods: + type: string + Access-Control-Expose-Headers: + type: string + Access-Control-Max-Age: + type: string + Access-Control-Allow-Credentials: + type: string + Cache-Control: + type: string +paths: + /hubs: + delete: + description: Delete Telnexus Hub record + operationId: deleteHub + parameters: + - $ref: "#/parameters/accountIdQuery" + responses: + "200": + $ref: "#/responses/DeleteResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Delete An Hub + tags: + - Hub + get: + description: Return a list of all available Hubs + operationId: getHubs + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/nameQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/activeQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/emailQuery" + responses: + "200": + $ref: "#/responses/HubResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a list of accounts + tags: + - Hub + options: + description: CORS support + operationId: accountOptions + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + post: + description: Hub record to be added + operationId: postHubs + parameters: + - $ref: "#/parameters/hubRequest" + responses: + "200": + $ref: "#/responses/HubResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Add a new account to Telnexus + tags: + - Hub + put: + description: Update Hubs + operationId: putHub + parameters: + - $ref: "#/parameters/hubRequest" + responses: + "200": + $ref: "#/responses/HubResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Update a single account + tags: + - Hub + /users: + get: + summary: "Check API Key" + operationId: "getUsers" + description: + "Checks for a valid API key, and returns full user record" + parameters: + - $ref: "#/parameters/apiKeyQuery" + tags: + - "User" + responses: + "200": + $ref: "#/responses/UserResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" +definitions: + DeleteResponse: + properties: + Data: + items: + $ref: "#/definitions/Message" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + Hub: + type: object + properties: + ID: + type: string + description: Record Id + AccountID: + type: string + description: Account + BillingContactID: + type: string + description: Billing Contact + ContactID: + type: string + description: Contact + CreatedById: + type: string + description: Created By + CreatedDate: + type: string + description: Created Date + CurrentUsers: + type: number + description: Current Users + Name: + type: string + description: Hub Name + MaxUsers: + type: number + description: Max Users + OrderItem: + type: string + description: Order Item + LastModifiedByID: + type: string + description: Last Modified By + LastModifiedDate: + type: string + description: Last Modifed Date + VendorID: + type: string + description: Vendor + VendorTenantID: + type: string + description: Vendor Tenant ID + Address: + properties: + City: + description: City + type: string + Country: + description: Country full name + type: string + CountryCode: + description: Country Code + type: string + PostalCode: + description: Postal Code + type: string + State: + description: State full name + type: string + StateCode: + description: State Code + type: string + Street: + description: Street number and name + type: string + type: object + Error: + properties: + Code: + format: int32 + type: integer + Fields: + type: string + Message: + type: string + type: object + Message: + properties: + message: + type: string + ref: + type: string + type: object + ResponseMeta: + properties: + Contact: + description: Microservice Contact Info + type: string + Copyright: + description: Copyright Info + type: string + License: + description: License Information and Restrictions + type: string + OperationID: + description: Operation ID + type: string + RequestIP: + description: Request IP Address + type: string + RequestType: + description: Request Type + type: string + RequestURL: + description: Request URL + type: string + ServerInfo: + description: Data Server Info + type: string + ServerResponseTime: + description: Data Server Response Time (ms) + type: string + ServerTimestamp: + description: Backend Server Timestamp + type: string + TelnexusAccount: + description: + Taxnexus Account Number used for recording transactions + type: string + type: object + HubRequest: + description: An array of Hub objects + properties: + Data: + items: + $ref: "#/definitions/Hub" + type: array + type: object + HubResponse: + description: An array of Hub objects + properties: + Data: + items: + $ref: "#/definitions/Hub" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + User: + properties: + AboutMe: + description: About Me + type: string + AccountID: + description: Account ID + type: string + Address: + $ref: "#/definitions/Address" + Alias: + description: Alias + type: string + APIKey: + description: API Key + type: string + Auth0UserID: + description: Auth0 User Id + type: string + CommunityNickname: + description: Nickname + type: string + CompanyName: + description: Company Name + type: string + ContactID: + description: Contact + type: string + CreatedByID: + description: Created User ID + type: string + CreatedDate: + description: Date Created + type: string + DelegatedApproverID: + description: Delegated Approver + type: string + Department: + description: Department + type: string + Division: + description: Division + type: string + Email: + description: Email address + type: string + EmployeeNumber: + description: Employee Number + type: string + EndOfDay: + description: Time day ends + type: string + Environment: + description: Environment + type: string + Extension: + description: Extension + type: string + FabricAPIKey: + description: Fabric API Key + type: string + Fax: + description: Fax + type: string + FirstName: + description: The first name + type: string + ForecastEnabled: + description: Allow Forecasting + type: boolean + FullPhotoURL: + description: Full Photo URL + type: string + ID: + description: Taxnexus ID + type: string + IsActive: + description: Active + type: boolean + IsPortalEnabled: + description: Is the user enabled for Communities? + type: boolean + IsProphilePhotoActive: + description: Has Profile Photo + type: boolean + IsSystemControlled: + type: boolean + LastModifiedByID: + description: Last Modified User ID + type: string + LastModifiedDate: + description: Last Modified Date + type: string + LastLogin: + description: Last login time + type: string + LastIP: + description: IP address of last login + type: string + LoginCount: + description: Number of times user has logged in + type: number + format: int64 + LastName: + description: The Last Name + type: string + ManagerID: + description: Manager + type: string + MobilePhone: + description: Mobile + type: string + Name: + description: Name + type: string + OutOfOfficeMessage: + description: Out of office message + type: string + Phone: + description: Phone + type: string + PortalRole: + description: Portal Role Level + type: string + ProfileID: + description: Profile + type: string + ReceivesAdminInfoEmails: + description: Admin Info Emails + type: boolean + ReceivesAdminEmails: + description: Info Emails + type: boolean + SenderEmail: + description: Email Sender Address + type: string + SenderName: + description: Email Sender Name + type: string + Signature: + description: Email Signature + type: string + SmallPhotoURL: + description: Small Photo URL + type: string + StartOfDay: + description: The time day starts + type: string + TelnexusAccount: + description: Taxnexus Account + type: string + TenantID: + description: Tenant ID associated with this user + type: string + TimeZone: + description: Time Zone + type: string + Title: + description: Title + type: string + Username: + description: Username + type: string + UserRoleID: + description: Role + type: string + UserType: + description: User Type + type: string + UserRoles: + items: + $ref: "#/definitions/UserRole" + type: array + TenantUsers: + items: + $ref: "#/definitions/TenantUser" + type: array + type: object + UserResponse: + description: An array Taxnexus user objects + properties: + Data: + items: + $ref: "#/definitions/User" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + UserRole: + description: Relationship object that connects user to a role + type: object + properties: + AccountID: + description: Account Id + type: string + Auth0RoleID: + description: Linked role ID + type: string + Auth0UserID: + description: Auth0 User ID + type: string + CompanyName: + description: Company Name + type: string + ContactID: + description: Contact ID + type: string + RoleDescription: + description: Role description + type: string + RoleID: + description: The Role ID + type: string + RoleName: + description: Role Name + type: string + TelnexusAccount: + description: Taxnexus Account Number + type: string + UserEmail: + description: User Email Address + type: string + UserFullName: + description: User Full Name + type: string + UserID: + description: The User ID + type: string + Username: + description: Username + type: string + TenantUser: + description: Relationship object that connects users to a tenant + type: object + properties: + AccessLevel: + description: The makeTenantUser access level for this User + type: string + Auth0UserID: + description: Auth0 User ID + type: string + AccountID: + description: Account ID + type: string + ContactID: + description: Contact ID + type: string + CompanyName: + description: Account Name + type: string + TelnexusAccount: + description: Taxnexus Account + type: string + TenantActive: + description: Tenant active? + type: boolean + TenantID: + description: The Tenant ID + type: string + TenantName: + description: Tenant Name + type: string + TenantStatus: + description: Tenant Status + type: string + TenantType: + description: Tenant type + type: string + TenantVersion: + description: Tenant Version + type: string + Username: + description: Username + type: string + UserEmail: + description: User Email Address + type: string + UserFullName: + description: User Full Name + type: string + UserID: + description: The User ID + type: string diff --git a/swagger/crm-telnexus.yaml b/swagger/crm-telnexus.yaml new file mode 100644 index 0000000..ad54be4 --- /dev/null +++ b/swagger/crm-telnexus.yaml @@ -0,0 +1,1679 @@ +swagger: "2.0" +info: + version: 0.0.2 + title: "crm" + description: "Customer Information Microservice" + termsOfService: "http://telnexus.com/terms/" + contact: + email: "noc@telnexus.com" + license: + name: "Proprietary - Copyright (c) 2018-2020 by Telnexus LLC" +securityDefinitions: + ApiKeyAuth: + type: "apiKey" + in: "header" + name: "X-API-Key" +schemes: + - "http" +basePath: "/v1" +host: "crm.infra.tnxs.net:8080" +consumes: + - "application/json" +produces: + - "application/json" +parameters: + accountIdQuery: + description: Telnexus Record Id of an Account + in: query + name: accountId + required: false + type: string + accountRequest: + description: An array of new Account records + in: body + name: accountRequest + required: true + schema: + $ref: "#/definitions/AccountRequest" + activeQuery: + description: Only retrieve active records? + in: query + name: active + required: false + type: boolean + companyIdQuery: + description: Telnexus Company record ID + in: query + name: companyId + required: false + type: string + leadIdQuery: + description: Telnexus Lead record ID + in: query + name: leadId + required: false + type: string + contactIdQuery: + description: Telnexus Contact record ID + in: query + name: contactId + required: false + type: string + emailQuery: + description: Email address used for identity lookup + in: query + name: email + required: false + type: string + contactRequest: + description: An array of new Contact records + in: body + name: contactsRequest + required: true + schema: + $ref: "#/definitions/ContactRequest" + leadRequest: + description: An array of new Lead records + in: body + name: leadRequest + required: true + schema: + $ref: "#/definitions/LeadRequest" + companyRequest: + description: An array of new Contact records + in: body + name: companiesRequest + required: true + schema: + $ref: "#/definitions/CompanyRequest" + limitQuery: + description: "How many objects to return at one time" + format: int64 + in: query + name: limit + required: false + type: integer + nameQuery: + description: The Name of this Object + in: query + name: name + required: false + type: string + offsetQuery: + description: How many objects to skip? + format: int64 + in: query + name: offset + required: false + type: integer + typeQuery: + description: The Type of this Object + in: query + name: type + required: false + type: string +responses: + AccessForbidden: + description: "Access forbidden, account lacks access" + headers: + Access-Control-Allow-Origin: + type: string + schema: + $ref: "#/definitions/Error" + AccountBasicResponse: + description: Telnexus Response with Account objects with Contacts + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + $ref: "#/definitions/AccountBasicResponse" + AccountResponse: + description: Telnexus Response with Account objects with Contacts + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + $ref: "#/definitions/AccountResponse" + AccountObservableResponse: + description: Telnexus Response with an array of Account objects + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + items: + $ref: "#/definitions/Account" + type: array + CompanyResponse: + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + description: Telnexus Response with Company objects + schema: + $ref: "#/definitions/CompanyResponse" + CompanyObservableResponse: + description: Telnexus Response with an array of Company objects + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + items: + $ref: "#/definitions/Company" + type: array + Conflict: + description: Conflict + headers: + Access-Control-Allow-Origin: + type: string + schema: + $ref: "#/definitions/Error" + ContactResponse: + description: Telnexus Response with an array of Contact objects + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + $ref: "#/definitions/ContactResponse" + ContactObservableResponse: + description: Telnexus Response with an array of Contact objects + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + items: + $ref: "#/definitions/Contact" + type: array + LeadResponse: + description: Telnexus Response with an array of Lead objects + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + $ref: "#/definitions/LeadResponse" + LeadObservableResponse: + description: Telnexus Response with an array of Lead objects + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + items: + $ref: "#/definitions/Lead" + type: array + DeleteResponse: + description: + Telnexus Response with Message Objects with Delete Status + headers: + Access-Control-Allow-Origin: + type: string + schema: + $ref: "#/definitions/DeleteResponse" + InvalidDataError: + headers: + Access-Control-Allow-Origin: + type: string + description: Invalid data was sent + schema: + $ref: "#/definitions/InvalidError" + NotFound: + description: Resource was not found + headers: + Access-Control-Allow-Origin: + type: string + schema: + $ref: "#/definitions/Error" + ServerError: + description: Server Internal Error + headers: + Access-Control-Allow-Origin: + type: string + schema: + $ref: "#/definitions/Error" + Unauthorized: + description: "Access unauthorized, invalid API-KEY was used" + headers: + Access-Control-Allow-Origin: + type: string + schema: + $ref: "#/definitions/Error" + UnprocessableEntity: + description: "Unprocessable Entity, likely a bad parameter" + headers: + Access-Control-Allow-Origin: + type: string + schema: + $ref: "#/definitions/Error" + CORSResponse: + description: CORS OPTIONS response + headers: + Access-Control-Allow-Origin: + type: string + Access-Control-Allow-Headers: + type: string + Access-Control-Allow-Methods: + type: string + Access-Control-Expose-Headers: + type: string + Access-Control-Max-Age: + type: string + Access-Control-Allow-Credentials: + type: string + Cache-Control: + type: string +paths: + /accounts: + delete: + description: Delete Telnexus Account record + operationId: deleteAccount + parameters: + - $ref: "#/parameters/accountIdQuery" + responses: + "200": + $ref: "#/responses/DeleteResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Delete An Account + tags: + - Accounts + get: + description: Return a list of all available Accounts + operationId: getAccounts + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/nameQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/activeQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/emailQuery" + responses: + "200": + $ref: "#/responses/AccountResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a list of accounts + tags: + - Accounts + options: + description: CORS support + operationId: accountOptions + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + post: + description: Account record to be added + operationId: postAccounts + parameters: + - $ref: "#/parameters/accountRequest" + responses: + "200": + $ref: "#/responses/AccountResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Add a new account to Telnexus + tags: + - Accounts + put: + description: Update a single account specified by accountId + operationId: putAccount + parameters: + - $ref: "#/parameters/accountRequest" + responses: + "200": + $ref: "#/responses/AccountResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Update a single account + tags: + - Accounts + /accounts/observable: + get: + description: A list of accounts in a simple JSON array + operationId: getAccountsObservable + parameters: + - $ref: "#/parameters/nameQuery" + - $ref: "#/parameters/activeQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/emailQuery" + responses: + "200": + $ref: "#/responses/AccountObservableResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get Telnexus Accounts in an observable array + tags: + - Accounts + options: + description: CORS support + operationId: accountOptionsObservable + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + /companies: + get: + description: Retrieve Company records from the datastore + operationId: getCompanies + parameters: + - $ref: "#/parameters/companyIdQuery" + responses: + "200": + $ref: "#/responses/CompanyResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get Company records + tags: + - Companies + options: + description: CORS support + operationId: companyOptions + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + post: + description: Add new companies + operationId: postCompanies + parameters: + - $ref: "#/parameters/companyRequest" + responses: + "200": + $ref: "#/responses/CompanyResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Add new companies + tags: + - Companies + /companies/observable: + get: + description: A list of companies in a simple JSON array + operationId: getCompaniesObservable + parameters: + - $ref: "#/parameters/companyIdQuery" + responses: + "200": + $ref: "#/responses/CompanyObservableResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get Telnexus Companies in an observable array + tags: + - Companies + options: + description: CORS support + operationId: companyObservableOptions + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + /contacts: + delete: + description: Delete Telnexus Contact record + operationId: deleteContact + parameters: + - $ref: "#/parameters/contactIdQuery" + responses: + "200": + $ref: "#/responses/DeleteResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Delete a Contact + tags: + - Contacts + get: + description: Return a list of all available Contacts + operationId: getContacts + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/contactIdQuery" + - $ref: "#/parameters/activeQuery" + - $ref: "#/parameters/emailQuery" + - $ref: "#/parameters/nameQuery" + responses: + "200": + $ref: "#/responses/ContactResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a list of contacts + tags: + - Contacts + options: + description: CORS support + operationId: contactOptions + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + post: + description: Contact record to be added + operationId: postContacts + parameters: + - $ref: "#/parameters/contactRequest" + responses: + "200": + $ref: "#/responses/ContactResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Add new contacts + tags: + - Contacts + put: + description: Update Contact records + operationId: putContacts + parameters: + - $ref: "#/parameters/contactRequest" + responses: + "200": + $ref: "#/responses/ContactResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Update Contact + tags: + - Contacts + /contacts/observable: + get: + description: A list of contacts in a simple JSON array + operationId: getContactsObservable + parameters: + - $ref: "#/parameters/contactIdQuery" + - $ref: "#/parameters/activeQuery" + - $ref: "#/parameters/emailQuery" + - $ref: "#/parameters/nameQuery" + responses: + "200": + $ref: "#/responses/ContactObservableResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get Telnexus Contacts in an observable array + tags: + - Contacts + options: + description: CORS support + operationId: contactOptionsObservable + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + /leads: + delete: + description: Delete Telnexus Lead record + operationId: deleteLead + parameters: + - $ref: "#/parameters/leadIdQuery" + responses: + "200": + $ref: "#/responses/DeleteResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Delete a Contact + tags: + - Leads + get: + description: Return a list of all available Leads + operationId: getLeads + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/leadIdQuery" + - $ref: "#/parameters/emailQuery" + - $ref: "#/parameters/nameQuery" + responses: + "200": + $ref: "#/responses/LeadResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a list of contacts + tags: + - Leads + options: + description: CORS support + operationId: leadOptions + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + post: + description: Lead records to be added + operationId: postLeads + parameters: + - $ref: "#/parameters/leadRequest" + responses: + "200": + $ref: "#/responses/LeadResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Add new Leads + tags: + - Leads + put: + description: Update Lead records + operationId: putLeads + parameters: + - $ref: "#/parameters/leadRequest" + responses: + "200": + $ref: "#/responses/LeadResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Update Leads + tags: + - Leads + /leads/observable: + get: + description: A list of leads in a simple JSON array + operationId: getLeadsObservable + parameters: + - $ref: "#/parameters/leadIdQuery" + - $ref: "#/parameters/emailQuery" + - $ref: "#/parameters/nameQuery" + responses: + "200": + $ref: "#/responses/LeadObservableResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get Telnexus Leads in an observable array + tags: + - Leads + options: + description: CORS support + operationId: leadOptionsObservable + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors +definitions: + Account: + properties: + AccountNumber: + description: Account Number + type: string + AccountSource: + description: The marketing orgin of this account + type: string + Active: + description: Active + type: boolean + AdministrativeLevel: + description: + "For tax authorities, this account's administrative level, + e.g. Local, County, State or Federal" + type: string + Amount: + description: Rollup Tax Amount + format: double + type: number + AmountInvoiced: + description: Amount Invoiced + format: double + type: number + AmountPaid: + description: Amount Paid + format: double + type: number + AnnualRevenue: + description: Annual Revenue Estimate + format: double + type: number + Balance: + description: Account Balance + format: double + type: number + BillingAddress: + $ref: "#/definitions/Address" + BillingContactID: + description: Contact ID + type: string + BillingPreference: + description: Billing Preference + type: string + BusinessAddress: + $ref: "#/definitions/Address" + CannabisCustomer: + description: Is this a cannabis customer? + type: boolean + ChannelProgramLevelName: + description: Channel Program Level Name + type: string + ChannelProgramName: + description: Channel Program Name + type: string + ClientEndDate: + description: Client End Date + type: string + ClientStartDate: + description: Client Start Date + type: string + CompanyID: + description: The Company ID of this Account + type: string + CoordinateID: + description: The Id of the geo coordinates of this account + type: string + CreatedByID: + description: Created By User ID + type: string + CreatedDate: + description: Created Date + type: string + CustomerID: + description: Customer ID from source system + type: string + CustomerPriority: + description: Customer Priority + type: string + DBA: + description: This Account's 'Doing Business As' name + type: string + DUNSNumber: + description: D-U-N-S Number + type: string + DandBCompanyID: + description: D-n-B Company + type: string + DefaultAddress: + $ref: "#/definitions/Address" + DefaultBackendID: + description: Default Backend ID + type: string + DefaultDeliveryContactID: + description: Default Delivery Address Contact ID + type: string + DefaultEndUserID: + description: Default End User Contact ID + type: string + Description: + description: Description + type: string + EIN: + description: EIN + type: string + Email: + description: Main Account Email + type: string + EnrollmentStatus: + description: Enrollment Status + type: string + Fax: + description: Fax + type: string + ID: + description: Telnexus Account Id + type: string + ISPCustomer: + description: ISP Customer? + type: boolean + Industry: + description: Industry + type: string + IsCustomerPortal: + description: Customer Portal Account + type: boolean + IsPartner: + description: Partner Account + type: boolean + JigSaw: + description: Data.com Key + type: string + LastModifiedByID: + description: Last Modified By User ID + type: string + LastModifiedDate: + description: Last Modified Date + type: string + MSPCustomer: + description: MSP Customer? + type: boolean + NAICSCode: + description: NAICS Code + type: string + NAICSDesc: + description: NAICS Description + type: string + Name: + description: Account Name + type: string + NumberOfEmployees: + description: Employee Count Estimate + format: int64 + type: number + NumberOfLocations: + description: Number of Locations Estimate + format: int64 + type: number + OpenCharges: + description: Open Charges + format: double + type: number + OrderContactID: + description: Vendor Order Contact ID + type: string + OrderEmail: + description: Order Email + type: string + OwnerID: + description: Account Owner User ID + type: string + Ownership: + description: Ownership + type: string + ParentFK: + description: Parent Foreign Key + type: string + ParentID: + description: Parent Account + type: string + Phone: + description: Phone + type: string + PlaceID: + description: + The ID of the Place situs record that applies to this Account + type: string + PreparerID: + description: Tax Preparer Contact ID + type: string + Rating: + description: Rating + type: string + RatingEngineID: + description: Rating Engine identifier + type: string + Ref: + description: External Reference ID + type: string + RevenueBase: + description: Rollup Revenue Base + format: double + type: number + RevenueNet: + description: Rollup Revenue Net + format: double + type: number + RevenueNotTaxable: + description: Rollup Revenue Not Taxable + format: double + type: number + SIC: + description: SIC Code + type: string + SICDesc: + description: SIC Description + type: string + ShippingAddress: + $ref: "#/definitions/Address" + ShippingCensusTract: + description: Shipping Census Tract + type: string + ShippingConactID: + description: Shipping Contact ID + type: string + ShippingCounty: + description: Shipping County + type: string + Site: + description: Account Site + type: string + Status: + description: Account Status + type: string + TaxExemption: + description: Tax Exemption + type: string + TaxOnTax: + description: Rollup Tax On Tax + format: double + type: number + TelecomCustomer: + description: Telecom Customer? + type: boolean + TenantID: + description: Tenant Identifier + type: string + TickerSymbol: + description: Ticker Symbol + type: string + TradeStyle: + description: Tradestyle + type: string + Type: + description: Type + type: string + UnappliedPayments: + description: Unapplied Payments + format: double + type: number + UnitBase: + description: Rollup Unit Base + type: number + UpsellOpportunity: + description: Upsell Opportunity + type: string + WHMCSClientID: + description: WHMCS Client ID + format: int64 + type: number + Website: + description: Website + type: string + XeroContactID: + description: Xero Contact ID + type: string + YearStarted: + description: Year Started + type: string + type: object + AccountBasic: + properties: + AccountNumber: + description: "Telnexus Account Number of the OEM/Reseller " + type: string + BillingAddress: + $ref: "#/definitions/Address" + BillingContactID: + description: Contact ID + type: string + CompanyID: + description: Telnexus OEM/Reseller Record Id + type: string + CoordinateID: + description: + The id of the Coordinate of the business establishment + type: string + CustomerID: + description: Taxpayer Customer Id designated by OEM/Reseller + type: string + DefaultAddress: + $ref: "#/definitions/Address" + type: string + DefaultBackendID: + description: Default Backend ID + type: string + DefaultDeliveryContactID: + description: Default Delivery Address Contact ID + type: string + DefaultEndUserID: + description: Contact ID + type: string + Email: + description: Taxpayer Public Email Address + type: string + Fax: + description: Taxpayer Fax Number + type: string + ID: + description: Taxpayer Account Record Id + type: string + Name: + description: Taxpayer Account Name (ignored for Tax Processing) + type: string + ParentFK: + description: + UUID Reference the master record that owns this item + type: string + Phone: + description: Taxpayer Public Phone Number + type: string + PreparerID: + description: Contact ID + type: string + Ref: + description: "Source System identifier for this record, if any" + type: string + ShippingAddress: + $ref: "#/definitions/Address" + description: Shipping Address + ShippingConactID: + description: Contact ID + type: string + Site: + description: Taxpayer Location Designation + type: string + TenantID: + description: Tenant Identifier + type: string + Type: + description: Account Type + type: string + Website: + description: Taxpayer Website + type: string + type: object + AccountBasicResponse: + properties: + Data: + items: + $ref: "#/definitions/AccountBasic" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + AccountRequest: + description: An array of Account objects with Contacts + properties: + Data: + items: + $ref: "#/definitions/Account" + type: array + type: object + AccountResponse: + description: An array of Account objects with Contacts + properties: + Data: + items: + $ref: "#/definitions/Account" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + Address: + properties: + City: + description: City + type: string + Country: + description: Country full name + type: string + CountryCode: + description: Country Code + type: string + PostalCode: + description: Postal Code + type: string + State: + description: State full name + type: string + StateCode: + description: State Code + type: string + Street: + description: Street number and name + type: string + type: object + Company: + properties: + AccountID: + description: Telnexus ID of the Account that owns this Company + type: string + AccountNumberPrefix: + description: Account Number Prefix + type: string + BillingAddress: + $ref: "#/definitions/Address" + BillingAdvice: + description: Billing Advice + type: string + BillingContactID: + description: Contact ID + type: string + BillingEmail: + description: Billing Email + type: string + BillingPhone: + description: Billing Phone + type: string + BillingWebsite: + description: Billing Website + type: string + COATemplateID: + description: Chart of Accounts Template Account ID + type: string + ColorAccent1: + description: Color Accent1 + type: string + ColorAccent2: + description: Color Accent2 + type: string + ColorPrimary: + description: Color Primary + type: string + CreatedByID: + description: Created By User ID + type: string + CreatedDate: + description: Created Date + type: string + CustomerSuccessID: + description: User ID of default Customer Success user + type: string + DateClosed: + description: Date Closed + type: string + DefaultAddress: + $ref: "#/definitions/Address" + DefaultCompany: + description: Default Company? + type: boolean + FontBody: + description: Font Name for Body Text + type: string + FontHeading: + description: Font Name for Heading + type: string + FontHeadingNarrow: + description: Font Name for Heading Narrow + type: string + FontLink: + description: Font Names for CSS Link + type: string + FontMono: + description: Font Name for Monospace + type: string + ID: + description: Telnexus Record Id + type: string + International: + description: International Customers? + type: boolean + LastAccountNumber: + description: Last Account Number + format: int64 + type: number + LastModifiedByID: + description: Last Modified By User ID + type: string + LastModifiedDate: + description: Last Modified Date + type: string + LastTaxTypeNumber: + description: Last TaxType Number + format: int64 + type: number + Logo: + description: Logo URL + type: string + Name: + description: Company Name + type: string + OwnerID: + description: The ID of the contact who owns this Company + type: string + PreparerID: + description: User ID of the default tax preparer + type: string + PricebookID: + description: The ID of the default Pricebook for this company + type: string + TenantID: + description: Tenant Identifier + type: string + UserTechLeadID: + description: + The ID of the contact who is the User Tech Lead for Company + type: string + type: object + CompanyRequest: + description: An array of Company objects + properties: + Data: + items: + $ref: "#/definitions/Company" + type: array + type: object + CompanyResponse: + description: An array of Company objects + properties: + Data: + items: + $ref: "#/definitions/Company" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + Contact: + properties: + AccountID: + description: The primary account ID of this contact + type: string + AssistantName: + description: Assistant Name + type: string + AssistantPhone: + description: Asst. Phone + type: string + BirthDate: + description: Birthdate + type: string + CreatedByID: + description: Created By User ID + type: string + CreatedDate: + description: Created Date + type: string + Department: + description: Department + type: string + Description: + description: Description + type: string + DoNotCall: + description: Do Not Call? + type: boolean + Email: + description: Email address + type: string + EmailBounceDate: + description: Email Bounce Date + type: string + EmailBouncedReason: + description: Email Bounce Reason + type: string + EnrollmentStatus: + description: Telnexus Enrollment Status + type: string + Fax: + description: Fax Number + type: string + FirstName: + description: First Name + type: string + HasOptedOutOfEmail: + description: Email Opt Out + type: boolean + HasOptedOutOfFax: + description: Fax Opt Out + type: boolean + HomePhone: + description: Home Phone + type: string + ID: + description: Telnexus Record Id + type: string + IsEmailBounced: + description: Does this contact have bounced emails? + type: boolean + IsProvisioned: + description: Is Provisioned? + type: boolean + LastModifiedByID: + description: Last Modified By User ID + type: string + LastModifiedDate: + description: Last Modified Date + type: string + LastName: + description: Last Name + type: string + LeadSource: + description: Lead Source + type: string + Level: + description: Level + type: string + LinkedIn: + description: LinkedIn Page + type: string + MailingAddress: + $ref: "#/definitions/Address" + MailingLists: + description: Mailing Lists + type: string + MobilePhone: + description: Mobile Phone + type: string + Name: + description: Full Name + type: string + OtherAddress: + $ref: "#/definitions/Address" + OtherPhone: + description: Other Phone + type: string + OwnerID: + description: The User ID of the user who owns this Contact + type: string + PersonalEmail: + description: Personal Email Address for this Contact + type: string + Phone: + description: Phone Number + type: string + PhotoURL: + description: URL of a photograph of this User + type: string + RecruitingStatus: + description: Recruiting Status + type: string + Ref: + description: "External reference to this contact, if any" + type: string + ReportsToID: + description: Reports To Contact ID + type: string + Salutation: + description: Contact Salutation + type: string + Status: + description: The Contact Status + type: string + TenantID: + description: Tenant Identifier + type: string + Title: + description: Contact Title + type: string + Type: + description: Contact Type + type: string + type: object + ContactRequest: + properties: + Data: + items: + $ref: "#/definitions/Contact" + type: array + type: object + ContactResponse: + properties: + Data: + items: + $ref: "#/definitions/Contact" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + DeleteResponse: + properties: + Data: + items: + $ref: "#/definitions/Message" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + Error: + properties: + Code: + format: int64 + type: integer + Fields: + type: string + Message: + type: string + type: object + InvalidError: + allOf: + - $ref: "#/definitions/Error" + - properties: + details: + items: + type: string + type: array + type: object + Lead: + properties: + Address: + $ref: "#/definitions/Address" + Company: + description: Company + type: string + CreatedByID: + description: Created By User ID + type: string + CreatedDate: + description: Created Date + type: string + Description: + description: Description + type: string + Email: + description: Email + type: string + FirstName: + description: First Name + type: string + ID: + description: Telnexus Record Id + type: string + LastModifiedByID: + description: Last Modified By User ID + type: string + LastModifiedDate: + description: Last Modified Date + type: string + LastName: + description: Last Name + type: string + MobilePhone: + description: Mobile + type: string + Name: + description: Name + type: string + OwnerId: + description: LeadBasic Owner + type: string + PartnerAccountId: + description: Partner Account + type: string + Phone: + description: Phone + type: string + ProductID: + description: Product + type: string + RefererURL: + description: referer_url + type: string + Status: + description: LeadBasic Status + type: string + TenantID: + description: Tenant Identifier + type: string + Title: + description: Title + type: string + Type: + description: Type + type: string + UTMCampaign: + description: utm_campaign + type: string + UTMContent: + description: utm_content + type: string + UTMMedium: + description: utm_medium + type: string + UTMSource: + description: utm_source + type: string + UTMTerm: + description: utm_term + type: string + Website: + description: Website + type: string + type: object + LeadRequest: + properties: + Data: + items: + $ref: "#/definitions/Lead" + type: array + type: object + LeadResponse: + properties: + Data: + items: + $ref: "#/definitions/Lead" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + Message: + properties: + message: + type: string + ref: + type: string + status: + format: int64 + type: number + type: object + Pagination: + properties: + limit: + format: int64 + type: number + pagesize: + format: int64 + type: number + poffset: + format: int64 + type: integer + setsize: + format: int64 + type: number + type: object + RequestMeta: + properties: + TelnexusAccount: + description: Telnexus Account Number of the Reseller or OEM + type: string + required: + - TelnexusAccount + type: object + ResponseMeta: + properties: + Contact: + description: Microservice Contact Info + type: string + Copyright: + description: Copyright Info + type: string + License: + description: License Information and Restrictions + type: string + OperationID: + description: Operation ID + type: string + Pagination: + $ref: "#/definitions/Pagination" + RequestIP: + description: Request IP Address + type: string + RequestType: + description: Request Type + type: string + RequestURL: + description: Request URL + type: string + ServerInfo: + description: Data Server Info + type: string + ServerResponseTime: + description: Data Server Response Time (ms) + type: string + ServerTimestamp: + description: Backend Server Timestamp + type: string + TelnexusAccount: + description: + Telnexus Account Number used for recording transactions + type: string + type: object diff --git a/swagger/devops-telnexus.yaml b/swagger/devops-telnexus.yaml new file mode 100644 index 0000000..044bb0b --- /dev/null +++ b/swagger/devops-telnexus.yaml @@ -0,0 +1,2802 @@ +swagger: "2.0" +info: + version: 0.0.2 + title: "devops" + description: "System Operations Microservice" + termsOfService: "http://telnexus.com/terms/" + contact: + email: "noc@telnexus.com" + license: + name: "Proprietary - Copyright (c) 2018-2020 by Telnexus LLC" +securityDefinitions: + ApiKeyAuth: + type: "apiKey" + in: "header" + name: "X-API-Key" +schemes: + - "http" +basePath: "/v1" +host: "devops.infra.tnxs.net:8080" +consumes: + - "application/json" +produces: + - "application/json" +parameters: + databaseIdQuery: + description: Telnexus Record Id of a Database + in: query + name: databaseId + required: false + type: string + TelnexusAccountQuery: + description: Telnexus Account of a Tenant + in: query + name: TelnexusAccount + required: false + type: string + tenantIdQuery: + description: Telnexus Record Id of a Tenant + in: query + name: tenantId + required: false + type: string + tenantRequest: + description: An array of Tenant records + in: body + name: TenantRequest + required: true + schema: + $ref: "#/definitions/TenantRequest" + databaseRequest: + description: An array of Database records + in: body + name: DatabaseRequest + required: true + schema: + $ref: "#/definitions/DatabaseRequest" + X-API-Key: + name: X-API-Key + in: "header" + required: true + type: string + ClusterRequest: + description: An array of Cluster records + in: body + name: ClusterRequest + required: true + schema: + $ref: "#/definitions/ClusterRequest" + IngestRequest: + description: An array of Ingest records + in: body + name: IngestRequest + required: true + schema: + $ref: "#/definitions/IngestRequest" + JobRequest: + description: An array of Job records + in: body + name: JobRequest + required: true + schema: + $ref: "#/definitions/JobRequest" + ServiceRequest: + description: An array of Service records + in: body + name: ServiceRequest + required: true + schema: + $ref: "#/definitions/ServiceRequest" + TemplateRequest: + description: An array of Template records + in: body + name: TemplateRequest + required: true + schema: + $ref: "#/definitions/TemplateRequest" + UserRequest: + description: An array of User records + in: body + name: UserRequest + required: true + schema: + $ref: "#/definitions/UserRequest" + accountIdQuery: + description: Telnexus Record Id of an Account + in: query + name: accountId + required: false + type: string + contactIdQuery: + description: Telnexus Record Id of a Contact + in: query + name: contactId + required: false + type: string + accountNumberQuery: + description: + The Telnexus Account Number of the Account to be used a record + retrieval + in: query + name: accountNumber + required: false + type: string + activeQuery: + description: Retrieve active records only? + in: query + name: active + required: false + type: boolean + apiKeyQuery: + description: Service account or developer API key + in: query + name: apikey + type: string + clusterIdPath: + description: Telnexus Record Id of a Cluster + in: path + name: clusterIdPath + type: string + required: true + databaseIdPath: + description: Telnexus Record Id of a Database + in: path + name: databaseIdPath + type: string + required: true + clusterIdQuery: + description: Telnexus Record Id of a Cluster + in: query + name: clusterId + required: false + type: string + companyIdQuery: + description: Telnexus Record Id of a Company + in: query + name: companyId + required: false + type: string + ingestIdPath: + description: Telnexus Record Id of a Ingest + in: path + name: ingestIdPath + type: string + required: true + ingestIdQuery: + description: Telnexus Record Id of an Ingest + in: query + name: ingestId + required: false + type: string + jobIdPath: + description: Telnexus Record Id of a Job + in: path + name: jobIdPath + type: string + required: true + jobIdQuery: + description: Telnexus Record Id of a Job + in: query + name: jobId + required: false + type: string + limitQuery: + description: "How many objects to return at one time" + format: int64 + in: query + name: limit + required: false + type: integer + offsetQuery: + description: How many objects to skip? (default 0) + format: int64 + in: query + name: offset + required: false + type: integer + serviceIdPath: + description: Telnexus Record Id of a Service + in: path + name: serviceIdPath + type: string + required: true + serviceIdQuery: + description: Service ID + in: query + name: serviceId + type: string + templateIdPath: + description: Telnexus Record Id of a Template + in: path + name: templateIdPath + type: string + required: true + templateIdQuery: + description: Template ID + in: query + name: templateId + type: string + objectTypeQuery: + description: Object Type Name + in: query + name: objectType + type: string + isMasterQuery: + description: Is Master Template? + in: query + name: isMaster + type: boolean + userIdPath: + description: Telnexus Record Id of a User + in: path + name: userIdPath + type: string + required: true + tenantIdPath: + description: Telnexus Record Id of a Tenant + in: path + name: tenantIdPath + type: string + required: true + userIdQuery: + description: Telnexus User ID (unique) + in: query + name: userId + type: string + emailQuery: + description: Email Address (not unique) + in: query + name: email + type: string + usernameQuery: + description: Username (unique) + in: query + name: username + type: string + userRequest: + description: An array of user records + in: body + name: UserRequest + required: true + schema: + $ref: "#/definitions/UserRequest" +responses: + AccessForbidden: + description: "Access forbidden, account lacks access" + headers: + Access-Control-Allow-Origin: + type: string + schema: + $ref: "#/definitions/Error" + ClusterSingletonResponse: + description: Single Cluster record response + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + $ref: "#/definitions/Cluster" + ClusterObservableResponse: + description: Single Cluster record response + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + type: array + items: + $ref: "#/definitions/Cluster" + ClusterResponse: + description: Telnexus Response with Cluster objects + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + $ref: "#/definitions/ClusterResponse" + DeveopsDeleteResponse: + description: + Telnexus Response with Message Objects with Delete Status + headers: + Access-Control-Allow-Origin: + type: string + schema: + $ref: "#/definitions/DeleteResponse" + IngestResponse: + description: Telnexus Response with Ingest objects + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + $ref: "#/definitions/IngestResponse" + IngestSingletonResponse: + description: Single Ingest record response + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + $ref: "#/definitions/Ingest" + IngestObservableResponse: + description: Single Ingest record response + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + type: array + items: + $ref: "#/definitions/Ingest" + JobResponse: + description: Telnexus Response with Job objects + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + $ref: "#/definitions/JobResponse" + JobSingletonResponse: + description: Single Job record response + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + $ref: "#/definitions/Job" + JobObservableResponse: + description: Single Job record response + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + type: array + items: + $ref: "#/definitions/Job" + NotFound: + headers: + Access-Control-Allow-Origin: + type: string + description: Resource was not found + schema: + $ref: "#/definitions/Error" + DatabaseResponse: + headers: + Access-Control-Allow-Origin: + type: string + description: Telnexus Response with Database objects + schema: + $ref: "#/definitions/DatabaseResponse" + DatabaseSingletonResponse: + description: Single Database record response + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + $ref: "#/definitions/Database" + DatabaseObservableResponse: + description: Single Database record response + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + type: array + items: + $ref: "#/definitions/Database" + TenantResponse: + headers: + Access-Control-Allow-Origin: + type: string + description: Telnexus Response with Tenant objects + schema: + $ref: "#/definitions/TenantResponse" + TenantSingletonResponse: + description: Single Tenant record response + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + $ref: "#/definitions/Tenant" + TenantObservableResponse: + description: Single Tenant record response + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + type: array + items: + $ref: "#/definitions/Tenant" + ServerError: + headers: + Access-Control-Allow-Origin: + type: string + description: Server Internal Error + schema: + $ref: "#/definitions/Error" + ServiceResponse: + description: Telnexus Response with Service objects + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + $ref: "#/definitions/ServiceResponse" + ServiceSingletonResponse: + description: Single Service record response + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + $ref: "#/definitions/Service" + ServiceObservableResponse: + description: Simple Service record response + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + type: array + items: + $ref: "#/definitions/Service" + TemplateResponse: + description: Telnexus Response with Template objects + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + $ref: "#/definitions/TemplateResponse" + TemplateSingletonResponse: + description: Single Template record response + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + $ref: "#/definitions/Template" + TemplateObservableResponse: + description: Simple Template record response + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + type: array + items: + $ref: "#/definitions/Template" + Unauthorized: + description: "Access Unauthorized, invalid API-KEY was used" + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + $ref: "#/definitions/Error" + UnprocessableEntity: + description: "Unprocessable Entity, likely a bad parameter" + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + $ref: "#/definitions/Error" + UserResponse: + description: Telnexus Response with User objects + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + $ref: "#/definitions/UserResponse" + UserSingletonResponse: + description: Single User record response + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + $ref: "#/definitions/User" + UserObservableResponse: + description: Simple User record response + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + type: array + items: + $ref: "#/definitions/User" + CORSResponse: + description: CORS OPTIONS response + headers: + Access-Control-Allow-Origin: + type: string + Access-Control-Allow-Headers: + type: string + Access-Control-Allow-Methods: + type: string + Access-Control-Expose-Headers: + type: string + Access-Control-Max-Age: + type: string + Access-Control-Allow-Credentials: + type: string + Cache-Control: + type: string +paths: + /clusters: + get: + description: Return a list of Cluster records from the datastore + operationId: getClusters + parameters: + - $ref: "#/parameters/clusterIdQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/ClusterResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a list Clusters + tags: + - Cluster + options: + description: CORS support + operationId: clustersOptions + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + post: + description: Create Clusters in Telnexus + operationId: postClusters + parameters: + - $ref: "#/parameters/ClusterRequest" + responses: + "200": + $ref: "#/responses/ClusterResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Create new Clusters + tags: + - Cluster + put: + description: Update Cluster in Telnexus + operationId: putClusters + parameters: + - $ref: "#/parameters/ClusterRequest" + responses: + "200": + $ref: "#/responses/ClusterResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Update Clustera + tags: + - Cluster + /clusters/observable: + get: + description: Returns a Cluster retrieval in a observable array + operationId: getClustersObservable + responses: + "200": + $ref: "#/responses/ClusterObservableResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get Clusters in an observable array + tags: + - Cluster + options: + description: CORS support + operationId: clusterOptions + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + "/clusters/{clusterIdPath}": + get: + description: + Return a single Cluster object from datastore as a Singleton + operationId: getCluster + parameters: + - $ref: "#/parameters/clusterIdPath" + responses: + "200": + $ref: "#/responses/ClusterSingletonResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a single Cluster object + tags: + - Cluster + /databases: + get: + description: Return a list of Database records from the datastore + operationId: getDatabases + parameters: + - $ref: "#/parameters/databaseIdQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/DatabaseResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a list Databases + tags: + - Database + options: + description: CORS support + operationId: databasesOptions + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + post: + description: Create Databases in Telnexus + operationId: postDatabases + parameters: + - $ref: "#/parameters/databaseRequest" + responses: + "200": + $ref: "#/responses/DatabaseResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Create new Databases + tags: + - Database + put: + description: Update Database in Telnexus + operationId: putDatabases + parameters: + - $ref: "#/parameters/databaseRequest" + responses: + "200": + $ref: "#/responses/DatabaseResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Update Databases + tags: + - Database + /databases/observable: + get: + description: Returns a Database retrieval in a observable array + operationId: getDatabasesObservable + responses: + "200": + $ref: "#/responses/DatabaseObservableResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get Databases in an observable array + tags: + - Database + options: + description: CORS support + operationId: databaseOptions + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + "/databases/{databaseIdPath}": + get: + description: + Return a single Database object from datastore as a Singleton + operationId: getDatabase + parameters: + - $ref: "#/parameters/databaseIdPath" + responses: + "200": + $ref: "#/responses/DatabaseSingletonResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a single Database object + tags: + - Database + /ingests: + get: + description: Return a list of Ingest records + operationId: getIngests + parameters: + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/ingestIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/IngestResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a list Ingests + tags: + - Ingest + options: + description: CORS support + operationId: ingestsOptions + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + post: + description: Create new Ingests + operationId: postIngests + parameters: + - $ref: "#/parameters/IngestRequest" + responses: + "200": + $ref: "#/responses/IngestResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Create new Ingests + tags: + - Ingest + put: + description: Update Ingests + operationId: putIngests + parameters: + - $ref: "#/parameters/IngestRequest" + responses: + "200": + $ref: "#/responses/IngestResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Update Ingests + tags: + - Ingest + /ingests/observable: + get: + description: Returns a Ingest retrieval in a observable array + operationId: getIngestsObservable + responses: + "200": + $ref: "#/responses/IngestObservableResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get Ingests in an observable array + tags: + - Ingest + options: + description: CORS support + operationId: ingestOptions + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + "/ingests/{ingestIdPath}": + get: + description: + Return a single Ingest object from datastore as a Singleton + operationId: getIngest + parameters: + - $ref: "#/parameters/ingestIdPath" + responses: + "200": + $ref: "#/responses/IngestSingletonResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a single Ingest object + tags: + - Ingest + /jobs: + get: + description: Return a list of Job records from the datastore + operationId: getJobs + parameters: + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/jobIdQuery" + - $ref: "#/parameters/activeQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/JobResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a list Jobs + tags: + - Job + options: + description: CORS support + operationId: jobsOptions + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + post: + description: Create and enqueue Jobs in Telnexus + operationId: postJobs + parameters: + - $ref: "#/parameters/JobRequest" + responses: + "200": + $ref: "#/responses/JobResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Create new Jobs + tags: + - Job + put: + description: Update Jobs in Telnexus + operationId: putJobs + parameters: + - $ref: "#/parameters/JobRequest" + responses: + "200": + $ref: "#/responses/JobResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Update Jobs + tags: + - Job + /jobs/observable: + get: + description: Returns a Job retrieval in a observable array + operationId: getJobsObservable + responses: + "200": + $ref: "#/responses/JobObservableResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get Jobs in an observable array + tags: + - Job + options: + description: CORS support + operationId: jobOptions + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + "/jobs/{jobIdPath}": + get: + description: + Return a single Job object from datastore as a Singleton + operationId: getJob + parameters: + - $ref: "#/parameters/jobIdPath" + responses: + "200": + $ref: "#/responses/JobSingletonResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a single Job object + tags: + - Job + /services: + get: + description: Return a list of Services records from the datastore + operationId: getServices + parameters: + - $ref: "#/parameters/serviceIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/ServiceResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a list of Services + tags: + - Service + options: + description: CORS support + operationId: servicesOptions + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + post: + description: Create Services in Telnexus + operationId: postServices + parameters: + - $ref: "#/parameters/ServiceRequest" + responses: + "200": + $ref: "#/responses/ServiceResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Create new Services + tags: + - Service + put: + description: Update Services in Telnexus + operationId: putServices + parameters: + - $ref: "#/parameters/ServiceRequest" + responses: + "200": + $ref: "#/responses/ServiceResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Update Services + tags: + - Service + /services/observable: + get: + description: Returns a Service retrieval in a observable array + operationId: getServicesObservable + responses: + "200": + $ref: "#/responses/ServiceObservableResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get Services in an observable array + tags: + - Service + options: + description: CORS support + operationId: serviceOptions + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + "/services/{serviceIdPath}": + get: + description: + Return a single Service object from datastore as a Singleton + operationId: getService + parameters: + - $ref: "#/parameters/serviceIdPath" + responses: + "200": + $ref: "#/responses/ServiceSingletonResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a single Service object + tags: + - Service + /templates: + get: + description: Return a list of Templates from the datastore + operationId: getTemplates + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/activeQuery" + - $ref: "#/parameters/templateIdQuery" + - $ref: "#/parameters/isMasterQuery" + - $ref: "#/parameters/objectTypeQuery" + responses: + "200": + $ref: "#/responses/TemplateResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a list Templates + tags: + - Template + options: + description: CORS support + operationId: templatesOptions + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + post: + description: Create new Templates + operationId: postTemplates + parameters: + - $ref: "#/parameters/TemplateRequest" + responses: + "200": + $ref: "#/responses/TemplateResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Create new Templates + tags: + - Template + /templates/observable: + get: + description: Returns a Template retrieval in a observable array + operationId: getTemplatesObservable + responses: + "200": + $ref: "#/responses/TemplateObservableResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get Templates in an observable array + tags: + - Template + options: + description: CORS support + operationId: templateOptions + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + "/templates/{templateIdPath}": + get: + description: + Return a single Template object from datastore as a Singleton + operationId: getTemplate + parameters: + - $ref: "#/parameters/templateIdPath" + responses: + "200": + $ref: "#/responses/TemplateSingletonResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a single Template object + tags: + - Template + /tenants: + get: + description: Return a list of Tenant records from the datastore + operationId: getTenants + parameters: + - $ref: "#/parameters/TelnexusAccountQuery" + - $ref: "#/parameters/tenantIdQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/TenantResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a list Tenants + tags: + - Tenant + options: + description: CORS support + operationId: tenantsOptions + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + post: + description: Create Tenants in Telnexus + operationId: postTenants + parameters: + - $ref: "#/parameters/tenantRequest" + responses: + "200": + $ref: "#/responses/TenantResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Create new Tenants + tags: + - Tenant + put: + description: Update Tenant in Telnexus + operationId: putTenants + parameters: + - $ref: "#/parameters/tenantRequest" + responses: + "200": + $ref: "#/responses/TenantResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Update Tenants + tags: + - Tenant + /tenants/observable: + get: + description: Returns a Tenant retrieval in a observable array + operationId: getTenantsObservable + responses: + "200": + $ref: "#/responses/TenantObservableResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get Tenants in an observable array + tags: + - Tenant + options: + description: CORS support + operationId: tenantOptions + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + "/tenants/{tenantIdPath}": + get: + description: + Return a single Tenant object from datastore as a Singleton + operationId: getTenant + parameters: + - $ref: "#/parameters/tenantIdPath" + responses: + "200": + $ref: "#/responses/TenantSingletonResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a single Tenant object + tags: + - Tenant + /users: + get: + description: Return a list of User records from the datastore + operationId: getUsers + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/contactIdQuery" + - $ref: "#/parameters/activeQuery" + - $ref: "#/parameters/emailQuery" + - $ref: "#/parameters/userIdQuery" + - $ref: "#/parameters/usernameQuery" + responses: + "200": + $ref: "#/responses/UserResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a list Users + tags: + - User + options: + description: CORS support + operationId: usersOptions + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + post: + description: Create new Users + operationId: postUsers + parameters: + - $ref: "#/parameters/UserRequest" + responses: + "200": + $ref: "#/responses/UserResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Create new Users + tags: + - User + put: + description: Update existing users + operationId: putUsers + parameters: + - $ref: "#/parameters/UserRequest" + responses: + "200": + $ref: "#/responses/UserResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Update existing users + tags: + - User + /users/observable: + get: + description: Returns a User retrieval in a observable array + operationId: getUsersObservable + responses: + "200": + $ref: "#/responses/UserObservableResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get Users in an observable array + tags: + - User + options: + description: CORS support + operationId: userOptions + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + "/users/{userIdPath}": + get: + description: + Return a single User object from datastore as a Singleton + operationId: getUser + parameters: + - $ref: "#/parameters/userIdPath" + responses: + "200": + $ref: "#/responses/UserSingletonResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a single User object + tags: + - User +definitions: + Address: + properties: + City: + description: City + type: string + Country: + description: Country full name + type: string + CountryCode: + description: Country Code + type: string + PostalCode: + description: Postal Code + type: string + State: + description: State full name + type: string + StateCode: + description: State Code + type: string + Street: + description: Street number and name + type: string + type: object + Cluster: + properties: + CreatedByID: + description: Created By + type: string + CreatedDate: + description: Created Date + type: string + Description: + description: Description + type: string + Environment: + description: Environment + type: string + Gateway: + description: Gateway + type: string + ID: + description: Telnexus Record Id + type: string + IPAddress: + description: IP Address + type: string + LastModifiedByID: + description: Last Modified By + type: string + LastModifiedDate: + description: Last Modified Date + type: string + Name: + description: Cluster Name + type: string + OwnerID: + description: Owner + type: string + Ref: + description: External Reference + type: string + Status: + description: Status + type: string + Subnet: + description: Subnet + type: string + Type: + description: Type + type: string + TenantID: + description: The ID of the tenant who owns this Database + type: string + Zone: + description: Zone + type: string + type: object + ClusterRequest: + properties: + Data: + items: + $ref: "#/definitions/Cluster" + type: array + type: object + ClusterResponse: + description: An array of cluster objects + properties: + Data: + items: + $ref: "#/definitions/Cluster" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + Database: + description: A Database provisioned and owned by a Tenant + properties: + Active: + description: Is this database active? + type: boolean + ClusterID: + description: + The ID of the Cluster in which this database is deployed + type: string + CreatedByID: + description: Created By + type: string + CreatedDate: + description: Created Date + type: string + DSN: + description: Database connection string + type: string + DatabaseName: + description: The name of the physical database in the cluster + type: string + ID: + description: Record Id + type: string + LastModifiedByID: + description: Last Modified By + type: string + LastModifiedDate: + description: Last Modifed Date + type: string + Microservices: + description: + List of Telnexus microservices implemented by this Database + type: string + Status: + description: The current status of this Tenant + type: string + TenantID: + description: The ID of the tenant who owns this Database + type: string + Type: + description: "The type of Database (mysql, etc)" + type: string + type: object + DatabaseRequest: + description: An array of Database objects + properties: + Data: + items: + $ref: "#/definitions/Database" + type: array + type: object + DatabaseResponse: + description: An array of Database objects + properties: + Data: + items: + $ref: "#/definitions/Database" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + DeleteResponse: + properties: + Data: + items: + $ref: "#/definitions/Message" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + Error: + properties: + code: + format: int64 + type: integer + fields: + type: string + message: + type: string + type: object + Ingest: + description: A record of the Ingest of information into Telnexus + properties: + AccountID: + description: Account ID + type: string + Amount: + description: Rollup Tax Amount + format: double + type: number + BackendID: + description: Backend ID + type: string + CompanyID: + description: Company ID + type: string + CreatedByID: + description: Telnexus User ID + type: string + CreatedDate: + description: Date of Job Creation + type: string + Description: + description: Ingest Description + type: string + EndDate: + description: End Date + type: string + Filename: + description: Filename + type: string + ID: + description: Record Id + type: string + IngestDate: + description: Ingest Date + type: string + IngestFailureReason: + description: Ingest Failure Reason + type: string + IngestType: + description: Ingest Type + enum: + - fabric + - internal + - suretax + - taxnexus-api + type: string + InvoiceCount: + description: Invoice Count + format: int64 + type: number + JobID: + description: Job ID + type: string + LastModifiedByID: + description: Telnexus User ID + type: string + LastModifiedDate: + description: Last Modified Date + type: string + MetrcLastModifiedEnd: + type: string + MetrcLastModifiedStart: + type: string + MetrcLicense: + description: License + type: string + MetrcSalesreceiptID: + format: int64 + type: number + MetrcState: + description: State Code + type: string + ObjectType: + description: Ingest Object Type + enum: + - account + - cash-receipt + - contact + - invoice + - order + - po + - quote + type: string + POCount: + description: PO Count + format: int64 + type: number + ParentFK: + description: Parent Foreign Key + type: string + PeriodID: + description: Period ID + type: string + PostFalureReason: + description: Post Failure Reason + type: string + RatingEngineID: + description: Rating Engine ID + type: string + Ref: + description: Source System Reference + type: string + RevenueBase: + description: Rollup Revenue Base + format: double + type: number + RevenueNet: + description: Rollup Revenue Net + format: double + type: number + RevenueNotTaxable: + description: Rollup Revenue Not Taxable + format: double + type: number + SagaID: + description: + The Saga ID used to link log entries and transactions + type: string + SagaType: + description: The type of Saga transaction being performed + type: string + Source: + description: The source system that generated this job + enum: + - api + - fabric + - taxnexus + - telnexus + type: string + StartDate: + description: Start Date + type: string + Status: + description: Ingest Status + enum: + - failed_accounting + - failed_existing + - failed_glpost + - failed_invoice + - failed_po + - ingested + - new + - posted + - queued + - rated + - rejected + type: string + Tax: + description: Rollup Tax + type: number + TaxOnTax: + description: Rollup Tax On Tax + type: number + TaxTransactionCount: + description: Tax Transaction Count + format: int64 + type: number + TemplateID: + description: Template + type: string + TenantID: + description: ID of the Tenant that owns this Object Instance + type: string + UnitBase: + description: Rollup Unit Base + format: int64 + type: number + required: + - AccountID + - ObjectType + type: object + IngestRequest: + properties: + Data: + items: + $ref: "#/definitions/Ingest" + type: array + type: object + IngestResponse: + description: An array of Print-Ready ingest Objects + properties: + Data: + items: + $ref: "#/definitions/Ingest" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + Job: + properties: + AccountID: + description: Telnexus Account Id + type: string + BackendID: + description: Telnexus Backend ID + type: string + CompanyID: + description: Telnexus Company ID + type: string + CoordinateID: + description: Telnexus Coordinate ID + type: string + CreatedByID: + description: Telnexus User ID + type: string + CreatedDate: + description: Date of Job Creation + type: string + Duration: + description: + The amount of time after the Start Time to perform one or more + jobs + enum: + - day + - document + - hour + - minute + - month + - quarter + - second + - week + - year + type: string + EndDate: + description: End Date/Time + type: string + ErrorReason: + description: Error Reason + type: string + ID: + description: Telnexus Record Id of the Job record + type: string + Interval: + description: + The time interval by which multiple jobs are executed within + the Duration + enum: + - day + - each + - hour + - minute + - month + - quarter + - second + - week + - year + type: string + JobDate: + description: Job Date + type: string + LastModifiedByID: + description: Last Modified By + type: string + LastModifiedDate: + description: Last Modified Date + type: string + Month: + description: The Month Number of the job + format: int64 + type: number + NextJobID: + description: Next Job + type: string + OwnerID: + description: The user ID that owns this job + type: string + Parameters: + description: The parameters needed to process the job + type: string + PeriodID: + description: Period + type: string + Quarter: + description: The Month Number of the job + format: int64 + type: number + RatingEngineID: + description: Rating Engine + type: string + Ref: + description: External Reference + type: string + Reschedule: + description: Reschedule? + type: boolean + RescheduleInterval: + description: Reschedule Interval + format: int64 + type: number + SagaID: + description: + The Saga ID used to link log entries and transactions + type: string + SagaType: + description: The type of Saga transaction being performed + type: string + Semiannual: + description: The Month Number of the job + format: int64 + type: number + Source: + description: The source system that generated this job + enum: + - api + - fabric + - taxnexus + - telnexus + type: string + StartDate: + description: Start Date/Time + type: string + Status: + description: Status + enum: + - active + - complete + - error + - new + - queued + type: string + Target: + description: The target system that executes this job + enum: + - api + - fabric + - taxnexus + - telnexus + type: string + TenantID: + description: ID of the Tenant that owns this Object Instance + type: string + Year: + description: The Month Number of the job + format: int64 + type: number + required: + - AccountID + - Duration + - SagaType + type: object + JobRequest: + properties: + Data: + items: + $ref: "#/definitions/Job" + type: array + type: object + JobResponse: + description: An array of Job Objects + properties: + Data: + items: + $ref: "#/definitions/Job" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + Message: + properties: + Message: + type: string + Ref: + type: string + Status: + type: integer + type: object + Pagination: + properties: + Limit: + format: int64 + type: integer + POffset: + format: int64 + type: integer + PageSize: + format: int64 + type: integer + SetSize: + format: int64 + type: integer + type: object + RequestMeta: + properties: + TelnexusAccount: + description: Telnexus Account Number of the Reseller or OEM + type: string + required: + - TelnexusAccount + type: object + ResponseMeta: + properties: + Contact: + description: Microservice Contact Info + type: string + Copyright: + description: Copyright Info + type: string + License: + description: License Information and Restrictions + type: string + OperationID: + description: Operation ID + type: string + Pagination: + $ref: "#/definitions/Pagination" + RequestIP: + description: Request IP Address + type: string + RequestType: + description: Request Type + type: string + RequestURL: + description: Request URL + type: string + ServerInfo: + description: Data Server Info + type: string + ServerResponseTime: + description: Data Server Response Time (ms) + type: string + ServerTimestamp: + description: Backend Server Timestamp + type: string + TelnexusAccount: + description: + Telnexus Account Number used for recording transactions + type: string + type: object + Role: + description: A functional role within a Tenant + properties: + Auth0RoleID: + description: The corresponding Auth0 Role + type: string + CreatedByID: + description: Created By + type: string + CreatedDate: + description: Created Date + type: string + Description: + description: Role Description + type: string + ID: + description: Record Id + type: string + LastModifiedByID: + description: Last Modified By + type: string + LastModifiedDate: + description: Last Modifed Date + type: string + RoleName: + description: The name of this role + type: string + TenantID: + description: The ID of the Tenant that owns this Role + type: string + type: object + RoleRequest: + description: An array of Role objects + properties: + Date: + items: + $ref: "#/definitions/Role" + type: array + type: object + RoleResponse: + description: An array of Role objects + properties: + Data: + items: + $ref: "#/definitions/Role" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + Service: + properties: + Active: + description: Active? + type: boolean + ClusterID: + description: Cluster + type: string + ClusterIP: + description: Cluster IP + type: string + ClusterURL: + description: Cluster URL + type: string + CreatedByID: + description: Created By + type: string + CreatedDate: + description: Created Date + type: string + Environment: + description: Environment + type: string + ExternalURL: + description: External URL + type: string + GELFAddress: + description: GELF Address + type: string + ID: + description: Telnexus Record Id + type: string + LastModifiedByID: + description: Last Modified By + type: string + LastModifiedDate: + description: Last Modified Date + type: string + NetworkAlias: + description: Network Alias + type: string + OpenAPIVersion: + description: OpenAPI Version + type: string + OwnerID: + description: Owner + type: string + PortExternal: + description: Port - External + type: string + PortTest: + description: Port - Test + type: string + ProxyType: + description: Proxy Type + type: string + Replicas: + description: Replicas + format: int64 + type: number + RepoURL: + description: Repo URL + type: string + ServiceName: + description: Service Name + type: string + TenantID: + description: The ID of the tenant who owns this Database + type: string + Version: + description: Version + type: string + type: object + ServiceRequest: + properties: + Data: + items: + $ref: "#/definitions/Service" + type: array + type: object + ServiceResponse: + description: An array of Service Objects + properties: + Data: + items: + $ref: "#/definitions/Service" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + Template: + properties: + CompanyID: + description: Company + type: string + CreatedByID: + type: string + CreatedDate: + type: string + Description: + description: Description + type: string + HTML: + description: HTML Body + format: byte + type: string + ID: + description: Telnexus Record Id + type: string + IsActive: + description: Active? + type: boolean + IsMaster: + description: Master Template? + type: boolean + LastModifiedByID: + type: string + LastModifiedDate: + type: string + Name: + description: Template Name + type: string + ObjectType: + description: Object + type: string + RecordTypeName: + description: Record Type Name + type: string + TenantID: + description: Tenant that owns this object instance + type: string + Type: + description: Type + type: string + URL: + description: URL + type: string + type: object + TemplateRequest: + description: An array of Templates + properties: + Data: + items: + $ref: "#/definitions/Template" + type: array + type: object + TemplateResponse: + description: An array of Templates + properties: + Data: + items: + $ref: "#/definitions/Template" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + Tenant: + description: Telnexus Account Tenant + properties: + AccountID: + description: The Account that owns this Tenant + type: string + Active: + description: Is this Tenant currently active? + type: boolean + CreatedByID: + description: Created By + type: string + CreatedDate: + description: Created Date + type: string + Databases: + items: + $ref: "#/definitions/Database" + type: array + ID: + description: Record Id + type: string + LastModifiedByID: + description: Last Modified By + type: string + LastModifiedDate: + description: Last Modifed Date + type: string + Roles: + items: + $ref: "#/definitions/Role" + type: array + Status: + description: The current status of this Tenant + type: string + TenantName: + description: Name of the Tenant Resource + type: string + TenantUsers: + items: + $ref: "#/definitions/TenantUser" + type: array + Type: + description: The type of Tenant + type: string + Version: + description: + The version number of the Tenant Onboarding system used to + create this tenant + type: string + type: object + TenantRequest: + description: An array of Tenant objects + properties: + Data: + items: + $ref: "#/definitions/Tenant" + type: array + type: object + TenantResponse: + description: An array of Tenant objects + properties: + Data: + items: + $ref: "#/definitions/Tenant" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + TenantUser: + description: Relationship object that connects users to a tenant + properties: + AccessLevel: + description: The makeTenantUser access level for this User + type: string + AccountID: + description: Account ID + type: string + Auth0UserID: + description: Auth0 User ID + type: string + CompanyName: + description: Account Name + type: string + ContactID: + description: Contact ID + type: string + TelnexusAccount: + description: Telnexus Account + type: string + TenantActive: + description: Tenant active? + type: boolean + TenantID: + description: The Tenant ID + type: string + TenantName: + description: Tenant Name + type: string + TenantStatus: + description: Tenant Status + type: string + TenantType: + description: Tenant type + type: string + TenantVersion: + description: Tenant Version + type: string + UserEmail: + description: User Email Address + type: string + UserFullName: + description: User Full Name + type: string + UserID: + description: The User ID + type: string + Username: + description: Username + type: string + type: object + User: + properties: + APIKey: + description: API Key + type: string + AboutMe: + description: About Me + type: string + AccountID: + description: Account ID + type: string + Address: + $ref: "#/definitions/Address" + Alias: + description: Alias + type: string + Auth0UserID: + description: Auth0 User Id + type: string + CommunityNickname: + description: Nickname + type: string + CompanyName: + description: Company Name + type: string + ContactID: + description: Contact + type: string + CreatedByID: + description: Created User ID + type: string + CreatedDate: + description: Date Created + type: string + DelegatedApproverID: + description: Delegated Approver + type: string + Department: + description: Department + type: string + Division: + description: Division + type: string + Email: + description: Email address + type: string + EmployeeNumber: + description: Employee Number + type: string + EndOfDay: + description: Time day ends + type: string + Environment: + description: Environment + type: string + Extension: + description: Extension + type: string + FabricAPIKey: + description: Fabric API Key + type: string + Fax: + description: Fax + type: string + FirstName: + description: The first name + type: string + ForecastEnabled: + description: Allow Forecasting + type: boolean + FullPhotoURL: + description: Full Photo URL + type: string + ID: + description: Telnexus ID + type: string + IsActive: + description: Active + type: boolean + IsPortalEnabled: + description: Is the user enabled for Communities? + type: boolean + IsProphilePhotoActive: + description: Has Profile Photo + type: boolean + IsSystemControlled: + type: boolean + LastIP: + description: IP address of last login + type: string + LastLogin: + description: Last login time + type: string + LastModifiedByID: + description: Last Modified User ID + type: string + LastModifiedDate: + description: Last Modified Date + type: string + LastName: + description: The Last Name + type: string + LoginCount: + description: Number of times user has logged in + format: int64 + type: number + ManagerID: + description: Manager + type: string + MobilePhone: + description: Mobile + type: string + Name: + description: Name + type: string + OutOfOfficeMessage: + description: Out of office message + type: string + Phone: + description: Phone + type: string + PortalRole: + description: Portal Role Level + type: string + ProfileID: + description: Profile + type: string + ReceivesAdminEmails: + description: Info Emails + type: boolean + ReceivesAdminInfoEmails: + description: Admin Info Emails + type: boolean + SenderEmail: + description: Email Sender Address + type: string + SenderName: + description: Email Sender Name + type: string + Signature: + description: Email Signature + type: string + SmallPhotoURL: + description: Small Photo URL + type: string + StartOfDay: + description: The time day starts + type: string + TelnexusAccount: + description: Telnexus Account + type: string + TenantID: + description: Tenant ID associated with this user + type: string + TenantUsers: + items: + $ref: "#/definitions/TenantUser" + type: array + TimeZone: + description: Time Zone + type: string + Title: + description: Title + type: string + UserRoleID: + description: Role + type: string + UserRoles: + items: + $ref: "#/definitions/UserRole" + type: array + UserType: + description: User Type + type: string + Username: + description: Username + type: string + type: object + UserRequest: + properties: + Data: + items: + $ref: "#/definitions/User" + type: array + type: object + UserResponse: + description: An array of Print-Ready ingest Objects + properties: + Data: + items: + $ref: "#/definitions/User" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + UserRole: + description: Relationship object that connects user to a role + properties: + AccountID: + description: Account Id + type: string + Auth0RoleID: + description: Linked role ID + type: string + Auth0UserID: + description: Auth0 User ID + type: string + CompanyName: + description: Company Name + type: string + ContactID: + description: Contact ID + type: string + RoleDescription: + description: Role description + type: string + RoleID: + description: The Role ID + type: string + RoleName: + description: Role Name + type: string + TelnexusAccount: + description: Telnexus Account Number + type: string + UserEmail: + description: User Email Address + type: string + UserFullName: + description: User Full Name + type: string + UserID: + description: The User ID + type: string + Username: + description: Username + type: string + type: object diff --git a/swagger/isp-telnexus.yaml b/swagger/isp-telnexus.yaml new file mode 100644 index 0000000..c15deb6 --- /dev/null +++ b/swagger/isp-telnexus.yaml @@ -0,0 +1,286 @@ +swagger: "2.0" +info: + version: 0.0.2 + title: isp + description: Telnexus ISP Microservice + termsOfService: http://telnexus.com/terms/ + contact: + email: noc@telnexus.com + license: + name: Proprietary - Copyright (c) 2012-2020 by Telnexus LLC +securityDefinitions: + ApiKeyAuth: + type: apiKey + in: header + name: X-API-Key +security: + - ApiKeyAuth: [] +schemes: + - http +basePath: /v1 +host: isp.infra.tnxs.net:8080 +consumes: + - application/json +produces: + - application/json +responses: + AccessForbidden: + description: "Access forbidden, account lacks access" + schema: + $ref: "#/definitions/Error" + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + NotFound: + description: Resource was not found + schema: + $ref: "#/definitions/Error" + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + ServerError: + description: Server Internal Error + schema: + $ref: "#/definitions/Error" + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + Unauthorized: + description: "Access Unauthorized, invalid API-KEY was used" + schema: + $ref: "#/definitions/Error" + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + UnprocessableEntity: + description: "Unprocessable Entity, likely a bad parameter" + schema: + $ref: "#/definitions/Error" + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + ZoneResponse: + description: Telnexus Response with an array of Zone objects + headers: + Access-Control-Allow-Origin: + type: string + Cache-Control: + type: string + schema: + $ref: "#/definitions/ZoneResponse" +parameters: + limitQuery: + default: 100 + description: + "How many objects to return at one time (max 300, default 100)" + format: int64 + in: query + name: limit + required: false + type: integer + offsetQuery: + default: 0 + description: How many objects to skip? (default 0) + format: int64 + in: query + name: offset + required: false + type: integer + accountIdQuery: + description: Telnexus Record Id of an Account + in: query + name: accountId + required: false + type: string + zoneIdQuery: + description: Telnexus Record Id of a Zone + in: query + name: zoneId + required: false + type: string +paths: + /zone: + get: + description: Get DNS Zones + summary: Get DNS Zones + tags: + - Zone + operationId: getZones + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/zoneIdQuery" + responses: + "200": + $ref: "#/responses/ZoneResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" +definitions: + Error: + properties: + code: + format: int64 + type: integer + fields: + type: string + message: + type: string + type: object + Registrar: + type: object + properties: + ID: + type: string + description: Record Id + AccountID: + type: string + description: Account + ContactID: + type: string + description: Contact + CreatedById: + type: string + description: Created By + CreatedDate: + type: string + description: Created Date + DateEnd: + type: string + description: End Date + DateStart: + type: string + description: Start Date + Description: + type: string + description: Description + LastModifiedById: + type: string + description: Last Modified By + LastModifiedDate: + type: string + description: Last Modifed Date + RegistrarName: + type: string + description: Registrar Name + URL: + type: string + description: Registrar URL + Zone: + type: object + properties: + ID: + type: string + description: Record Id + AccountID: + type: string + description: Account + ContactID: + type: string + description: Contact + CreatedById: + type: string + description: Created By + CreatedDate: + type: string + description: Created Date + DateEnd: + type: string + description: End Date + DateStart: + type: string + description: Start Date + Description: + type: string + description: Description + ExpirationDate: + type: string + description: Expiration Date + IDProtect: + type: boolean + description: ID Protect? + HostID: + type: string + description: The ID of the Host upon which this Zone is hosted + LastModifiedById: + type: string + description: Last Modified By + LastModifiedDate: + type: string + description: Last Modifed Date + PeriodStartID: + type: boolean + description: Auto Renew? + RegistrarID: + type: string + description: ID of the Registar that owns this zone instance + Term: + type: string + description: Term + ZoneName: + type: string + description: Zone Name + ZoneResponse: + description: An array of Zone objects + properties: + data: + items: + $ref: "#/definitions/Zone" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + ResponseMeta: + properties: + Contact: + description: Microservice Contact Info + type: string + Copyright: + description: Copyright Info + type: string + License: + description: License Information and Restrictions + type: string + OperationID: + description: Operation ID + type: string + RequestIP: + description: Request IP Address + type: string + RequestType: + description: Request Type + type: string + RequestURL: + description: Request URL + type: string + ServerInfo: + description: Data Server Info + type: string + ServerResponseTime: + description: Data Server Response Time (ms) + type: string + ServerTimestamp: + description: Backend Server Timestamp + type: string + TelnexusAccount: + description: + Telnexus Account Number used for recording transactions + type: string + type: object diff --git a/swagger/kazoo-telnexus.yaml b/swagger/kazoo-telnexus.yaml new file mode 100644 index 0000000..1c20286 --- /dev/null +++ b/swagger/kazoo-telnexus.yaml @@ -0,0 +1,1343 @@ +swagger: "2.0" +info: + version: 0.0.1 + title: voip + description: Telnexus VoIP Microservice + termsOfService: http://telnexus.com/terms/ + contact: + email: noc@telnexus.com + license: + name: Proprietary - Copyright (c) 2012-2020 by Telnexus LLC +securityDefinitions: + ApiKeyAuth: + type: apiKey + in: header + name: X-Auth-Token +security: + - ApiKeyAuth: [] +schemes: + - https +basePath: /v2 +host: api.zswitch.net:8443 +consumes: + - application/json +produces: + - application/json +responses: + GetDeviceResponse: + description: Kazoo response + schema: + $ref: "#/definitions/GetDeviceResponse" + GetNumberResponse: + description: Kazoo response + schema: + $ref: "#/definitions/GetNumberResponse" + GetAccountGroupResponse: + description: Kazoo response + schema: + $ref: "#/definitions/GetAccountGroupResponse" + GetAccountMediaResponse: + description: Kazoo response + schema: + $ref: "#/definitions/GetAccountMediaResponse" + GetAccountCallflowResponse: + description: Kazoo response + schema: + $ref: "#/definitions/GetAccountCallflowResponse" + GetAccountVmBoxResponse: + description: Kazoo response + schema: + $ref: "#/definitions/GetAccountVmBoxResponse" + GetAccountUserResponse: + description: Kazoo response + schema: + $ref: "#/definitions/GetAccountUserResponse" + GetAccountTimeRuleResponse: + description: Kazoo response + schema: + $ref: "#/definitions/GetAccountTimeRuleResponse" + GetKazooNumberResponse: + description: Kazoo response + schema: + $ref: "#/definitions/GetKazooNumberResponse" + GetAccountResponse: + description: Kazoo response + schema: + $ref: "#/definitions/GetAccountResponse" + GetAccountCdrResponse: + description: Kazoo response + schema: + $ref: "#/definitions/GetAccountCdrResponse" + GetAccountMenusResponse: + description: Kazoo response + schema: + $ref: "#/definitions/GetAccountMenusResponse" + GetAccountDescendentResponse: + description: Kazoo response + schema: + $ref: "#/definitions/GetAccountDescendentResponse" + AccessForbidden: + description: "Access forbidden, account lacks access" + schema: + $ref: "#/definitions/Error" + NotFound: + description: Resource was not found + schema: + $ref: "#/definitions/Error" + ServerError: + description: Server Internal Error + schema: + $ref: "#/definitions/Error" + Unauthorized: + description: "Access Unauthorized, invalid API-KEY was used" + schema: + $ref: "#/definitions/Error" + UnprocessableEntity: + description: "Unprocessable Entity, likely a bad parameter" + schema: + $ref: "#/definitions/Error" +parameters: + limitQuery: + default: 100 + description: + "How many objects to return at one time (max 300, default 100)" + format: int64 + in: query + name: limit + required: false + type: integer + offsetQuery: + default: 0 + description: How many objects to skip? (default 0) + format: int64 + in: query + name: offset + required: false + type: integer + startDateQuery: + type: number + format: int64 + in: query + name: created_from + required: true + endDateQuery: + type: number + format: int64 + in: query + name: created_to + required: true + accountIdPath: + type: string + in: path + name: accountId + required: true + userIdPath: + type: string + in: path + name: userId + required: true + prefixQuery: + name: prefix + type: number + format: int32 + in: query + required: false + quantityQuery: + name: quantity + type: number + format: int32 + in: query + required: false +paths: + /accounts/{accountId}: + get: + operationId: getAccounts + tags: + - Account + parameters: + - $ref: "#/parameters/accountIdPath" + responses: + "200": + $ref: "#/responses/GetAccountResponse" + "401": + $ref: "#/responses/Unauthorized" + "404": + $ref: "#/responses/NotFound" + /accounts/{accountId}/descendents: + get: + operationId: getAccountDescendents + tags: + - Account + parameters: + - $ref: "#/parameters/accountIdPath" + responses: + "200": + $ref: "#/responses/GetAccountDescendentResponse" + "401": + $ref: "#/responses/Unauthorized" + "404": + $ref: "#/responses/NotFound" + /accounts/{accountId}/users/{userId}/devices: + get: + operationId: getUserDevices + tags: + - Device + parameters: + - $ref: "#/parameters/accountIdPath" + - $ref: "#/parameters/userIdPath" + responses: + "200": + $ref: "#/responses/GetDeviceResponse" + "401": + $ref: "#/responses/Unauthorized" + "404": + $ref: "#/responses/NotFound" + /accounts/{accountId}/users: + get: + operationId: getAccountUsers + tags: + - User + parameters: + - $ref: "#/parameters/accountIdPath" + responses: + "200": + $ref: "#/responses/GetAccountUserResponse" + "401": + $ref: "#/responses/Unauthorized" + "404": + $ref: "#/responses/NotFound" + /accounts/{accountId}/vmboxes: + get: + operationId: getAccountVmBoxes + tags: + - User + parameters: + - $ref: "#/parameters/accountIdPath" + responses: + "200": + $ref: "#/responses/GetAccountVmBoxResponse" + "401": + $ref: "#/responses/Unauthorized" + "404": + $ref: "#/responses/NotFound" + /accounts/{accountId}/devices: + get: + operationId: getAccountDevices + tags: + - Device + parameters: + - $ref: "#/parameters/accountIdPath" + responses: + "200": + $ref: "#/responses/GetDeviceResponse" + "401": + $ref: "#/responses/Unauthorized" + "404": + $ref: "#/responses/NotFound" + /accounts/{accountId}/media: + get: + operationId: getAccountMedia + tags: + - Media + parameters: + - $ref: "#/parameters/accountIdPath" + responses: + "200": + $ref: "#/responses/GetAccountMediaResponse" + "401": + $ref: "#/responses/Unauthorized" + "404": + $ref: "#/responses/NotFound" + /accounts/{accountId}/temporal_rules: + get: + operationId: getAccountTimeRules + tags: + - TimeRule + parameters: + - $ref: "#/parameters/accountIdPath" + responses: + "200": + $ref: "#/responses/GetAccountTimeRuleResponse" + "401": + $ref: "#/responses/Unauthorized" + "404": + $ref: "#/responses/NotFound" + /accounts/{accountId}/menus: + get: + operationId: getAccountMenus + tags: + - Menu + parameters: + - $ref: "#/parameters/accountIdPath" + responses: + "200": + $ref: "#/responses/GetAccountMenusResponse" + "401": + $ref: "#/responses/Unauthorized" + "404": + $ref: "#/responses/NotFound" + /accounts/{accountId}/phone_numebers: + get: + operationId: getAccountNumbers + tags: + - PhoneNumber + parameters: + - $ref: "#/parameters/accountIdPath" + responses: + "200": + $ref: "#/responses/GetNumberResponse" + "401": + $ref: "#/responses/Unauthorized" + "404": + $ref: "#/responses/NotFound" + /phone_numebers: + get: + operationId: getKazooNumbers + tags: + - PhoneNumber + parameters: + - $ref: "#/parameters/prefixQuery" + - $ref: "#/parameters/quantityQuery" + responses: + "200": + $ref: "#/responses/GetKazooNumberResponse" + "401": + $ref: "#/responses/Unauthorized" + "404": + $ref: "#/responses/NotFound" + /accounts/{accountId}/groups: + get: + operationId: getAccountGroups + tags: + - Group + parameters: + - $ref: "#/parameters/accountIdPath" + responses: + "200": + $ref: "#/responses/GetAccountGroupResponse" + "401": + $ref: "#/responses/Unauthorized" + "404": + $ref: "#/responses/NotFound" + /accounts/{accountId}/callflows: + get: + operationId: getAccountCallflows + tags: + - CallFlow + parameters: + - $ref: "#/parameters/accountIdPath" + responses: + "200": + $ref: "#/responses/GetAccountCallflowResponse" + "401": + $ref: "#/responses/Unauthorized" + "404": + $ref: "#/responses/NotFound" + /accounts/{accountId}/cdrs: + get: + operationId: getAccountCDRs + tags: + - cdr + parameters: + - $ref: "#/parameters/accountIdPath" + - $ref: "#/parameters/startDateQuery" + - $ref: "#/parameters/endDateQuery" + responses: + "200": + $ref: "#/responses/GetAccountCdrResponse" + "401": + $ref: "#/responses/Unauthorized" + "404": + $ref: "#/responses/NotFound" +definitions: + Error: + properties: + code: + format: int32 + type: integer + fields: + type: string + message: + type: string + type: object + GetAccountCdrResponse: + properties: + auth_token: + type: string + data: + items: + properties: + authorizing_id: + example: f9627ff1bcca2d112931ee00dcfdb0c6 + type: string + billing_seconds: + example: 0 + type: number + bridge_id: + example: 1967142278_134071066@67.231.5.176 + type: string + call_id: + example: 2b35a5ec-43a1-11ea-99b1-ed64c60fd1ac + type: string + call_priority: + example: "" + type: string + call_type: + example: "" + type: string + callee_id_name: + example: Telnexus + type: string + callee_id_number: + example: "+15108597000" + type: string + caller_id_name: + example: Unavailable + type: string + caller_id_number: + example: "+17045943795" + type: string + calling_from: + example: "+17045943795" + type: string + cost: + example: "0" + type: string + datetime: + example: "2020-01-30 20:43:28" + type: string + dialed_number: + example: user_jaemid + type: string + direction: + example: outbound + type: string + duration_seconds: + example: 15 + type: number + from: + example: +17045943795@e0f5f0.s.zswitch.net + type: string + hangup_cause: + example: ORIGINATOR_CANCEL + type: string + id: + example: 202001-2b35a5ec-43a1-11ea-99b1-ed64c60fd1ac + type: string + interaction_id: + example: 63747636207-cc274afb + type: string + iso_8601: + example: "2020-01-30" + type: string + iso_8601_combined: + example: "2020-01-30T20:43:28Z" + type: string + media_server: + example: fs004.ord.p.zswitch.net + type: string + other_leg_call_id: + example: 1967142278_134071066@67.231.5.176 + type: string + owner_id: + example: c0a881b0dfbc7fc574cb67dcaf10879f + type: string + rate: + example: "0.0" + type: string + rate_name: + example: "" + type: string + recording_url: + example: "" + type: string + request: + example: user_jaemid@e0f5f0.s.zswitch.net + type: string + rfc_1036: + example: "Thu, 30 Jan 2020 20:43:28 GMT" + type: string + timestamp: + example: "63747636208" + type: string + to: + example: user_jaemid@e0f5f0.s.zswitch.net + type: string + unix_timestamp: + example: "1580417008" + type: string + type: object + type: array + node: + example: dqZFtHthbelyE8MI6vU-LA + type: string + page_size: + example: "534" + type: string + request_id: + example: e7897c563fb45f3b377046d9b54c3cb5 + type: string + start_key: + example: g2wAAAACbgUAAOqn1w5oAWpq + type: string + status: + example: success + type: string + timestamp: + example: "2020-05-07T01:06:49Z" + type: string + version: + example: 4.3.103 + type: string + GetAccountCallflowResponse: + properties: + auth_token: + example: >- + eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImM2M2I1NjY5YmE0NTQzZWVmMTE5OTc3ZTUyNDYxYzRlIn0.eyJpc3MiOiJrYXpvbyIsImlkZW50aXR5X3NpZyI6InJUMW5DNnNOOHNKQWp4blBSSk1LVE5Ed1ZEQWZwek9sSFBnb0FYTHgtQU0iLCJhY2NvdW50X2lkIjoiYTY2ZjJiN2E0MDk0NGI3NDRkY2M2M2NhNmYxMGY0N2EiLCJvd25lcl9pZCI6IjUwOTE2MWZmMmE1NzZiZDZhYmU1YjhjNzVmNmIxNWYwIiwibWV0aG9kIjoiY2JfdXNlcl9hdXRoIiwiZXhwIjoxNTg4ODE0OTcwfQ.cW38X_JKe_bToQ19LzPY1U4aqjf96cFSwkszhqMhdpoR2Kq5JuPxkuCWoG6q49lwpIHb_9mZyoYBG83eLnYkamcORoejyUDb0ob79VKMBAUHAlXPkMNz7H2apLEHp0O8bdxr8ymh0Il9I4nAZSVnPkufQpx8L41Oy_ovU0vHS0jb2dSeXsySO0qcrCsoR9psTtqvB1GZBCEO8S_9EJKpYaT3o-Kio8uHZh7HgCD3NCUbfW8emfE6omTFIzIY7FTwXM_4kaMbWTUv09nN7iIpxJw2r_2drT-V5K8GFXZLAvm_1CqtLOMTYb26i3Iae3-zh9GPANSU3O0fq79kKupHfw + type: string + data: + items: + properties: + featurecode: + properties: + name: + example: park_and_retrieve + type: string + number: + example: "3" + type: string + type: object + id: + example: ff059d91a6fe0d16ced1ef6ca1f2bc52 + type: string + modules: + example: + - park + items: + type: string + type: array + name: + example: 2004 - Vern iPad + type: string + numbers: + example: + - "2004" + items: + type: string + type: array + patterns: + example: + - '^\*3([0-9]*)$' + items: + type: string + type: array + type: object + type: array + node: + example: dqZFtHthbelyE8MI6vU-LA + type: string + page_size: + example: 34 + type: number + request_id: + example: 3aa5241a8f3150258750425ce3c5c767 + type: string + revision: + example: c10c73dd4f798fb595267e1d1c4eb9ff + type: string + status: + example: success + type: string + timestamp: + example: "2020-05-07T00:53:40Z" + type: string + version: + example: 4.3.103 + type: string + GetAccountDescendentResponse: + properties: + auth_token: + example: >- + eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImM2M2I1NjY5YmE0NTQzZWVmMTE5OTc3ZTUyNDYxYzRlIn0.eyJpc3MiOiJrYXpvbyIsImlkZW50aXR5X3NpZyI6InJUMW5DNnNOOHNKQWp4blBSSk1LVE5Ed1ZEQWZwek9sSFBnb0FYTHgtQU0iLCJhY2NvdW50X2lkIjoiYTY2ZjJiN2E0MDk0NGI3NDRkY2M2M2NhNmYxMGY0N2EiLCJvd25lcl9pZCI6IjUwOTE2MWZmMmE1NzZiZDZhYmU1YjhjNzVmNmIxNWYwIiwibWV0aG9kIjoiY2JfdXNlcl9hdXRoIiwiZXhwIjoxNTg4ODA3NjcyfQ.rsxUwAef3JnHzTc4eckxIx_RToGbNsKr3WVUoVDEPQ7slKLxhpfDTrNqXQ_kou-1646Z539YQCQGRsB5One4BfEDAfhAmH63d6jKwEU49yQUiZCBn8tbuzN4iiZmYn6z8wmqUQHO2KA3fo6IKrjggs3t1EK8iG05se4ltS21ZVQ-C0HVvvENoERu9iKEcM2SeKhl9Ucl3cqQpWRKBN9BEvTKpuXqM_Bkf2FiczQ3TJQ2SS0YJTYjoIKnOLHfM4H59ZcPwnTh0S3zplJ8e6dQv6t020x0gVYdA_U9EseIGhNQTtMEAztwleZJwdpBh6kiDxJb9-l4ENX4kFtvxsH4QQ + type: string + data: + items: + properties: + id: + example: 7cebd991bd99ffd909dbb08a7d8e2db4 + type: string + name: + example: Affinity + type: string + realm: + example: b5df22.s.zswitch.net + type: string + tree: + example: + - fb7cc960d5037466992af0e9504d0b27 + - d4804caa6d7a78c83ff2bc7fdf646398 + - 33776f3f94eb642c81e199cf5f1059ae + - a66f2b7a40944b744dcc63ca6f10f47a + items: + type: string + type: array + type: object + type: array + node: + example: dqZFtHthbelyE8MI6vU-LA + type: string + page_size: + example: 48 + type: number + request_id: + example: 0035dec0e0e4c486e3bcd4502cf6a95d + type: string + revision: + example: b3a4cb72580c7c2f93572a6ef2748b74 + type: string + start_key: + example: g20AAAAA + type: string + status: + example: success + type: string + timestamp: + example: "2020-05-06T23:01:48Z" + type: string + version: + example: 4.3.103 + type: string + type: object + GetAccountResponse: + properties: + auth_token: + example: >- + eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImM2M2I1NjY5YmE0NTQzZWVmMTE5OTc3ZTUyNDYxYzRlIn0.eyJpc3MiOiJrYXpvbyIsImlkZW50aXR5X3NpZyI6InJUMW5DNnNOOHNKQWp4blBSSk1LVE5Ed1ZEQWZwek9sSFBnb0FYTHgtQU0iLCJhY2NvdW50X2lkIjoiYTY2ZjJiN2E0MDk0NGI3NDRkY2M2M2NhNmYxMGY0N2EiLCJvd25lcl9pZCI6IjUwOTE2MWZmMmE1NzZiZDZhYmU1YjhjNzVmNmIxNWYwIiwibWV0aG9kIjoiY2JfdXNlcl9hdXRoIiwiZXhwIjoxNTg4ODA3NjcyfQ.rsxUwAef3JnHzTc4eckxIx_RToGbNsKr3WVUoVDEPQ7slKLxhpfDTrNqXQ_kou-1646Z539YQCQGRsB5One4BfEDAfhAmH63d6jKwEU49yQUiZCBn8tbuzN4iiZmYn6z8wmqUQHO2KA3fo6IKrjggs3t1EK8iG05se4ltS21ZVQ-C0HVvvENoERu9iKEcM2SeKhl9Ucl3cqQpWRKBN9BEvTKpuXqM_Bkf2FiczQ3TJQ2SS0YJTYjoIKnOLHfM4H59ZcPwnTh0S3zplJ8e6dQv6t020x0gVYdA_U9EseIGhNQTtMEAztwleZJwdpBh6kiDxJb9-l4ENX4kFtvxsH4QQ + type: string + data: + properties: + available_apps: + example: + - voip + - cluster + - userportal + - accounts + - developer + - pbxs + - numbers + items: + type: string + type: array + billing_id: + example: a66f2b7a40944b744dcc63ca6f10f47a + type: string + billing_mode: + example: manual + type: string + call_restriction: + properties: + caribbean: + properties: + action: + example: inherit + type: string + type: object + did_us: + properties: + action: + example: inherit + type: string + type: object + directory: + properties: + action: + example: inherit + type: string + type: object + emergency: + properties: + action: + example: inherit + type: string + type: object + international: + properties: + action: + example: inherit + type: string + type: object + toll_us: + properties: + action: + example: inherit + type: string + type: object + tollfree_us: + properties: + action: + example: inherit + type: string + type: object + unknown: + properties: + action: + example: inherit + type: string + type: object + type: object + caller_id: + properties: + emergency: + properties: + name: + example: Telnexus + type: string + number: + example: "+15109911114" + type: string + type: object + external: + properties: + name: + example: Telnexus + type: string + number: + example: "+15109911114" + type: string + type: object + type: object + contact: + properties: + billing: + properties: + email: + example: noc@telnexus.com + type: string + name: + example: "" + type: string + number: + example: "5108597000" + type: string + type: object + technical: + properties: + email: + example: noc@telnexus.com + type: string + number: + example: "5108497000" + type: string + type: object + type: object + created: + example: 63552627756 + format: int64 + type: number + descendants_count: + example: 48 + type: number + enabled: + example: true + type: boolean + format_from_uri: + example: false + type: boolean + id: + example: a66f2b7a40944b744dcc63ca6f10f47a + type: string + is_reseller: + example: false + type: boolean + language: + example: en-us + type: string + media: + properties: + bypass_media: + example: auto + type: string + type: object + name: + example: Telnexus Direct + type: string + notification_preference: + example: teletype + type: string + notifications: + properties: + fax_to_email: + properties: + service_name: + example: support@telnexus.com + type: string + service_provider: + example: support@telnexus.com + type: string + service_url: + example: telnexus.com + type: string + support_email: + example: support@telnexus.com + type: string + support_number: + example: 510-991-1114 + type: string + type: object + low_balance: + properties: + sent_low_balance: + example: false + type: boolean + type: object + voicemail_to_email: + properties: + service_name: + example: support@telnexus.com + type: string + service_provider: + example: support@telnexus.com + type: string + service_url: + example: telnexus.com + type: string + support_email: + example: support@telnexus.com + type: string + support_number: + example: 510-991-1114 + type: string + type: object + type: object + provision: + properties: + admin_password: + type: string + type: object + realm: + example: f5b70e.s.zswitch.net + type: string + reseller_id: + example: 33776f3f94eb642c81e199cf5f1059ae + type: string + superduper_admin: + example: false + type: boolean + timezone: + example: America/Los_Angeles + type: string + ui_metadata: + properties: + origin: + example: accounts + type: string + ui: + example: monster-ui + type: string + version: + example: 4.1-56 + type: string + type: object + ui_restrictions: + properties: + myaccount: + properties: + account: + properties: + show_tab: + example: true + type: boolean + type: object + balance: + properties: + show_credit: + example: true + type: boolean + show_header: + example: true + type: boolean + show_minutes: + example: true + type: boolean + show_tab: + example: true + type: boolean + type: object + billing: + properties: + show_tab: + example: true + type: boolean + type: object + errorTracker: + properties: + show_tab: + example: true + type: boolean + type: object + inbound: + properties: + show_tab: + example: true + type: boolean + type: object + outbound: + properties: + show_tab: + example: true + type: boolean + type: object + service_plan: + properties: + show_tab: + example: true + type: boolean + type: object + transactions: + properties: + show_tab: + example: true + type: boolean + type: object + twoway: + properties: + show_tab: + example: true + type: boolean + type: object + user: + properties: + show_tab: + example: true + type: boolean + type: object + type: object + type: object + wnm_allow_additions: + example: false + type: boolean + type: object + node: + example: dqZFtHthbelyE8MI6vU-LA + type: string + request_id: + example: 1bea6f4e37f65627452f9798d8398385 + type: string + revision: + example: 270-8664316349384947d416dc00285fb532 + type: string + status: + example: success + type: string + timestamp: + example: "2020-05-06T22:42:58Z" + type: string + version: + example: 4.3.103 + type: string + type: object + GetDeviceResponse: + properties: + page_size: + type: number + example: 4 + data: + type: array + items: + type: object + properties: + id: + type: string + example: "f9627ff1bcca2d112931ee00dcfdb0c6" + name: + type: string + example: "2007 - Vern iPhone Personal" + username: + type: string + example: "user_jaemid" + mac_address: + type: string + example: string + owner_id: + type: string + example: "c0a881b0dfbc7fc574cb67dcaf10879f" + enabled: + type: "boolean" + example: true + device_type: + type: string + example: "softphone" + revision: + type: string + example: "794a8debed3fca4330ba2373cd703773" + timestamp: + type: string + example: "2020-05-07T01:20:21Z" + version: + type: string + example: "4.3.103" + node: + type: string + example: "dqZFtHthbelyE8MI6vU-LA" + request_id: + type: string + example: "29c9cccc07016866243a9dbd9481c88a" + status: + type: string + example: "success" + auth_token: + type: string + GetAccountGroupResponse: + properties: + page_size: + type: number + example: 3 + data: + type: array + items: + type: object + properties: + id: + type: string + example: "e9e0627a0d41c4be4e8fa65a6d4777aa" + name: + type: string + example: "Berkeley Office" + endpoints: + type: number + example: 5 + revision: + type: string + example: "ac7c6fde786a11c16c4dd265eccb9aa5" + timestamp: + type: string + example: "2020-05-07T01:36:50Z" + version: + type: string + example: "4.3.103" + node: + type: string + example: "dqZFtHthbelyE8MI6vU-LA" + request_id: + type: string + example: "22d1269690b8a553106e929bd8923a55" + status: + type: string + example: "success" + auth_token: + type: string + GetAccountMediaResponse: + properties: + page_size: + type: number + example: 49 + data: + type: array + items: + type: object + properties: + id: + type: string + example: "fea26d66047257e74c132092b149e533" + name: + type: string + example: "test" + media_source: + type: string + example: "tts" + language: + type: string + example: "en-us" + is_prompt: + type: "boolean" + example: false + revision: + type: string + example: "b74319c4b8fb8cdba510362fa98facf0" + timestamp: + type: string + example: "2020-05-07T01:41:49Z" + version: + type: string + example: "4.3.103" + node: + type: string + example: "dqZFtHthbelyE8MI6vU-LA" + request_id: + type: string + example: "6e6dc6f474d1aa1689ac27a3c0605b38" + status: + type: string + example: "success" + auth_token: + type: string + GetAccountMenusResponse: + properties: + page_size: + type: number + example: 18 + data: + type: array + items: + type: object + properties: + id: + type: string + example: "fe46dd5b556ce876ce693b2d49b6402d" + name: + type: string + example: "RecordingStudio" + revision: + type: string + example: "d512f1f2cff2684eec3825938f23275b" + timestamp: + type: string + example: "2020-05-07T01:53:07Z" + version: + type: string + example: "4.3.103" + node: + type: string + example: "dqZFtHthbelyE8MI6vU-LA" + request_id: + type: string + example: "36c57100bce810968df34f77465e974a" + status: + type: string + example: "success" + auth_token: + type: string + GetNumberResponse: + properties: + page_size: + type: number + example: 117 + data: + properties: + numbers: + properties: + numberitem: + properties: + state: + type: string + example: "in_service" + features: + type: array + items: + type: string + example: + - "local" + assigned_to: + type: string + example: "a66f2b7a40944b744dcc63ca6f10f47a" + created: + type: number + example: 63714718327 + updated: + type: number + example: 63755492918 + features_available: + type: array + items: + type: string + example: + - "cnam" + - "e911" + - "force_outbound" + - "port" + - "prepend" + - "ringback" + type: object + type: object + cascade_quantity: + type: number + example: 61 + type: object + revision: + type: string + example: "7c9f4f30f97ba288bad4f0f620e9e0bc" + timestamp: + type: string + example: "2020-05-07T01:56:53Z" + version: + type: string + example: "4.3.103" + node: + type: string + example: "dqZFtHthbelyE8MI6vU-LA" + request_id: + type: string + example: "a73973839c028f42519105681482b64f" + status: + type: string + example: "success" + auth_token: + type: string + GetKazooNumberResponse: + properties: + data: + type: array + items: + type: object + properties: + number: + type: string + example: "+15183486324" + state: + type: string + example: "discovery" + timestamp: + type: string + example: "2020-05-07T02:30:03Z" + version: + type: string + example: "4.3.103" + node: + type: string + example: "dqZFtHthbelyE8MI6vU-LA" + request_id: + type: string + example: "b310489bd3933c740590b2dcec953de8" + status: + type: string + example: "success" + auth_token: + type: string + GetAccountTimeRuleResponse: + properties: + page_size: + type: number + example: 1 + data: + type: array + items: + type: object + properties: + id: + type: string + example: "1c3939fd0afcdadaa2986bc61c787d03" + name: + type: string + example: "Business Hours" + revision: + type: string + example: "b694bae5e001d52cf40637b618bc6bfb" + timestamp: + type: string + example: "2020-05-07T02:43:06Z" + version: + type: string + example: "4.3.103" + node: + type: string + example: "dqZFtHthbelyE8MI6vU-LA" + request_id: + type: string + example: "7372ec1ec4dc316cd0a8cf6786defde6" + status: + type: string + example: "success" + auth_token: + type: string + GetAccountUserResponse: + properties: + page_size: + type: number + example: 4 + data: + type: array + items: + type: object + properties: + id: + type: string + example: "8c571470fef7db363994c8427c07b7bb" + features: + type: array + items: + type: string + example: + - "vm_to_email" + username: + type: string + example: "phil" + email: + type: string + example: "reception@telnexus.com" + first_name: + type: string + example: "Phil" + last_name: + type: string + example: "Cranepool" + priv_level: + type: string + example: "user" + timezone: + type: string + example: "America/Los_Angeles" + revision: + type: string + example: "c989520cf895f314b32d163d3b59d723" + timestamp: + type: string + example: "2020-05-07T02:44:28Z" + version: + type: string + example: "4.3.103" + node: + type: string + example: "dqZFtHthbelyE8MI6vU-LA" + request_id: + type: string + example: "c11b939a99b181b3a09b7770c4e49302" + status: + type: string + example: "success" + auth_token: + type: string + GetAccountVmBoxResponse: + properties: + page_size: + type: number + example: 5 + data: + type: array + items: + type: object + properties: + id: + type: string + example: "cbd3606fea91c9b834c5a1fc0efa1098" + name: + type: string + example: "2005 - Bill VM" + mailbox: + type: string + example: "2005" + owner_id: + type: string + example: "f95626ebc2db4fd1a2b5ac5f6b11f7a3" + messages: + type: number + example: 12 + revision: + type: string + example: "171c5eb1c826f66fe16cfb0669f55994" + timestamp: + type: string + example: "2020-05-07T02:52:10Z" + version: + type: string + example: "4.3.103" + node: + type: string + example: "dqZFtHthbelyE8MI6vU-LA" + request_id: + type: string + example: "0452de0d2fbef2cbccafaf7b3894bc0b" + status: + type: string + example: "success" + auth_token: + type: string diff --git a/swagger/sf-gate-telnexus.yaml b/swagger/sf-gate-telnexus.yaml new file mode 100644 index 0000000..4f86be2 --- /dev/null +++ b/swagger/sf-gate-telnexus.yaml @@ -0,0 +1,9169 @@ +swagger: "2.0" +info: + title: "sf-gate" + version: 0.0.2 + description: "Salesforce Gateway Microservice" + termsOfService: "http://telnexus.com/terms/" + contact: + email: "noc@telnexus.com" + license: + name: "Proprietary - Copyright (c) 2018-2020 by Telnexus LLC" +schemes: + - "http" +basePath: "/v1" +host: "sf-gate.infra.tnxs.net:8080" +securityDefinitions: + ApiKeyAuth: + type: apiKey + in: header + name: X-API-Key +security: + - ApiKeyAuth: [] +consumes: + - application/json +produces: + - application/json +parameters: + accountIdQuery: + description: + Telnexus Id of the Account to be used a record retrieval + in: query + name: accountId + required: false + type: string + accountIdQueryRequired: + description: + Telnexus Id of the Account to be used a record retrieval + in: query + name: accountId + required: true + type: string + accountNumberQuery: + description: + The Telnexus Account Number of the Account to be used a record + retrieval + in: query + name: accountNumber + required: false + type: string + accountRequest: + description: A request with an array of Account Objects + in: body + name: accountRequest + required: true + schema: + $ref: "#/definitions/AccountRequest" + accountTypeQuery: + description: The Type of this Object + enum: + - channel_partner_member + - channel_partner_prospect + - new + - other + - system + - tax_administrator_member + - tax_administrator_prospect + - taxpayer_customer + - taxpayer_prospect + in: query + name: type + required: false + type: string + activeQuery: + description: Retrieve only active records? + in: query + name: active + required: false + type: boolean + addressQuery: + description: Postal Address URL encoded; partial addresses allowed + in: query + name: address + required: false + type: string + apiKeyQuery: + description: Telnexus Id of the User to be retrieved + in: query + name: apikey + required: false + type: string + authorityIdQuery: + description: Telnexus Id of the Authority to be retrieved + in: query + name: authorityId + required: false + type: string + authorityRequestBody: + description: A request with an array of Authority Objects + in: body + name: authorityRequest + required: true + schema: + $ref: "#/definitions/AuthorityRequest" + roleIdQuery: + description: Telnexus Id of the Role to be retrieved + in: query + name: roleId + required: false + type: string + backendIdQuery: + description: Telnexus Id of the Backend to be retrieved + in: query + name: backendId + required: false + type: string + backendRequestBody: + description: An array of new Backend records + in: body + name: backendsRequest + required: true + schema: + $ref: "#/definitions/BackendRequest" + cashReceiptIdQuery: + description: Telnexus Record Id of a Cash Receipt + in: query + name: cashReceiptId + required: false + type: string + cashReceiptRequest: + description: The response to a Cash Receipt Request + in: body + name: cashReceiptRequest + required: true + schema: + $ref: "#/definitions/CashReceiptRequest" + clusterIdQuery: + description: Telnexus Record Id of a Cluster + in: query + name: clusterId + required: false + type: string + databaseIdQuery: + description: Telnexus Record Id of a Database + in: query + name: databaseId + required: false + type: string + tenantIdQuery: + description: Telnexus Record Id of a Tenant + in: query + name: tenantId + required: false + type: string + clusterRequest: + description: An array of Cluster records + in: body + name: ClusterRequest + required: true + schema: + $ref: "#/definitions/ClusterRequest" + tenantRequest: + description: An array of Tenant records + in: body + name: CTenantRequest + required: true + schema: + $ref: "#/definitions/TenantRequest" + databaseRequest: + description: An array of Database records + in: body + name: DatabaseRequest + required: true + schema: + $ref: "#/definitions/DatabaseRequest" + companyIdQuery: + description: Telnexus Id of the Company to be retrieved + in: query + name: companyId + required: false + type: string + contactIdQuery: + description: Telnexus Id of the Contact to be retrieved + in: query + name: contactId + required: false + type: string + contactRequest: + description: An array of new Contact records + in: body + name: contactsRequest + required: true + schema: + $ref: "#/definitions/ContactRequest" + countryIdQuery: + description: The Country Telnexus ID + in: query + name: countryId + required: false + type: string + countryQuery: + description: The Country abbreviation (2 char) + in: query + name: country + required: false + type: string + countyIdQuery: + description: The County Telnexus ID + in: query + name: countyId + required: false + type: string + countyQuery: + description: The County Name + in: query + name: county + required: false + type: string + dateFromQuery: + description: The Starting Date for an object retrieval + in: query + name: dateFrom + required: false + type: string + dateToQuery: + description: The Ending Date for an object retrieval + in: query + name: dateTo + required: false + type: string + documentIdQuery: + description: Telnexus Id of the Document to be retrieved + in: query + name: documentId + required: false + type: string + domainIdQuery: + description: Telnexus Id of the Domain to be retrieved + in: query + name: domainId + required: false + type: string + domainQuery: + description: "The Tax Domain to rate (cannabis, sales or telecom)" + in: query + name: name + required: false + type: string + filingIdQuery: + description: Telnexus Id of the Filing to be retrieved + in: query + name: filingId + required: false + type: string + filingRequestBody: + description: A request with an array of Filing Objects + in: body + name: filingRequest + required: true + schema: + $ref: "#/definitions/FilingRequest" + filingTypeIdQuery: + description: Telnexus Record Id of a Filing + in: query + name: filingTypeId + required: false + type: string + filingTypeRequest: + description: A request with an array of FilingType Objects + in: body + name: FilingTypeRequest + required: true + schema: + $ref: "#/definitions/FilingTypeRequest" + glAccountRequest: + description: An array of new Statement records + in: body + name: glAccountRequest + required: true + schema: + $ref: "#/definitions/GlAccountRequest" + glBalanceIdQueryRequired: + description: Telnexus Id of a GL Balance Record + in: query + name: glbalanceId + required: true + type: string + idRequestBody: + description: An array of existing Telnexus Record IDs + in: body + name: idsRequest + required: true + schema: + $ref: "#/definitions/IdsRequest" + ingestIdQuery: + description: Telnexus Record Id of an Ingest + in: query + name: ingestId + required: false + type: string + ingestRequest: + description: An array of new Ingest records + in: body + name: IngestRequest + required: true + schema: + $ref: "#/definitions/IngestRequest" + invoiceIdQuery: + description: Telnexus Id of the Invoice to be retrieved + in: query + name: invoiceId + required: false + type: string + invoiceRequestBody: + description: An array of new Invoice records + in: body + name: invoicesRequest + required: true + schema: + $ref: "#/definitions/InvoiceRequest" + jobIdQuery: + description: Telnexus Record Id of a Job record + in: query + name: jobId + required: false + type: string + jobRequest: + description: An array of new Job records + in: body + name: JobRequest + required: true + schema: + $ref: "#/definitions/JobRequest" + journalEntryRequest: + description: An array of Journal Entry records + in: body + name: journalEntryRequest + required: true + schema: + $ref: "#/definitions/SubmissionRequest" + licenseIdQuery: + description: Telnexus Id of the License to be retrieved + in: query + name: licenseId + required: false + type: string + licenseTypeIdQuery: + description: Telnexus Id of the License Type to be retrieved + in: query + name: licensetypeId + required: false + type: string + limitQuery: + description: "How many objects to return at one time" + format: int64 + in: query + name: limit + required: false + type: integer + masterQuery: + description: Retrieve only master records? + in: query + name: master + required: false + type: boolean + nameQuery: + description: The Name of this Object + in: query + name: name + required: false + type: string + offsetQuery: + description: How many objects to skip? (default 0) + format: int64 + in: query + name: offset + required: false + type: integer + orderIdQuery: + description: Telnexus Id of the Company to be retrieved + in: query + name: orderId + required: false + type: string + periodIdQuery: + description: Telnexus Id of the Period to be used a record retrieval + in: query + name: periodId + required: false + type: string + periodIdQueryRequired: + description: + Telnexus Id of the Period to be used in a record retrieval + in: query + name: periodId + required: true + type: string + periodNameQueryRequired: + description: The Telnexus Accounting Period + in: query + name: period + required: false + type: string + periodRequest: + description: An array of Period records + in: body + name: periodRequest + required: true + schema: + $ref: "#/definitions/PeriodRequest" + placeIdQuery: + description: The City name (must be accompanied by State) + in: query + name: placeId + required: false + type: string + placeQuery: + description: The City name (must be accompanied by State) + in: query + name: place + required: false + type: string + poIdQuery: + description: Telnexus Id of the Purchase Order to be retrieved + in: query + name: poId + required: false + type: string + productIdQuery: + description: + Telnexus Id of the Account to be used a record retrieval + in: query + name: productId + required: false + type: string + productRequestBody: + description: A request with an array of Product Objects + in: body + name: productRequest + required: true + schema: + $ref: "#/definitions/ProductRequest" + productdQuery: + description: Telnexus Id of the Product to be retrieved + in: query + name: productId + required: false + type: string + quoteIdQuery: + description: Telnexus Id of the Company to be retrieved + in: query + name: quoteId + required: false + type: string + serviceIdQuery: + description: Service ID + in: query + name: serviceId + type: string + serviceRequest: + description: An array of Service records + in: body + name: ServiceRequest + required: true + schema: + $ref: "#/definitions/ServiceRequest" + stateIdQuery: + description: The State or Province abbreviation (2 char) + in: query + name: stateId + required: false + type: string + stateQuery: + description: The State or Province abbreviation (2 char) + in: query + name: state + required: false + type: string + statementIdQuery: + description: Telnexus Id of the Company to be retrieved + in: query + name: statementId + required: false + type: string + statementRequestBody: + description: An array of new Statement records + in: body + name: statementsRequest + required: true + schema: + $ref: "#/definitions/StatementRequest" + submissionIdQuery: + description: Telnexus Id of the Submisssion to be retrieved + in: query + name: submissionId + required: false + type: string + submissionRequestBody: + description: An array of new Submission records + in: body + name: submisssionsRequest + required: true + schema: + $ref: "#/definitions/SubmissionRequest" + subscriptionIdQuery: + description: Telnexus Id of the Subscription to be retrieved + in: query + name: subscriptionId + required: false + type: string + subscriptionRequestBody: + description: A request with an array of Subscription Objects + in: body + name: subscriptionRequest + required: true + schema: + $ref: "#/definitions/SubscriptionRequest" + taxInvoiceRequestBody: + description: A list of InvoiceBasic objects + in: body + name: taxInvoicesRequest + required: true + schema: + $ref: "#/definitions/TaxInvoicesRequest" + taxOrderRequestBody: + description: A list of InvoiceBasic objects + in: body + name: taxOrdersRequest + required: true + schema: + $ref: "#/definitions/TaxOrdersRequest" + taxPoRequestBody: + description: A list of PurchaseOrderBasic objects + in: body + name: taxPosRequest + required: true + schema: + $ref: "#/definitions/TaxPurchaseOrdersRequest" + taxQuoteRequestBody: + description: A list of InvoiceBasic objects + in: body + name: taxQuotesRequest + required: true + schema: + $ref: "#/definitions/TaxQuotesRequest" + taxTypeAccountIdQuery: + description: Telnexus Id of the Tax Type Account to be retrieved + in: query + name: taxtypeaccountId + required: false + type: string + taxTypeIdQuery: + description: Telnexus Id of the Tax Type to be retrieved + in: query + name: taxtypeId + required: false + type: string + taxnexuscodeIdQuery: + description: Telnexus Id of the Telnexus Code to be retrieved + in: query + name: taxnexuscodeId + required: false + type: string + templateIdQuery: + description: Telnexus Record Id of a Template + in: query + name: templateId + required: false + type: string + typeQuery: + description: The Type of this Object + in: query + name: type + required: false + type: string + userIdQuery: + description: Telnexus Id of the User to be retrieved + in: query + name: userId + required: false + type: string + notebookIdQuery: + description: Template ID + in: query + name: notebookId + type: string + notebookRequest: + description: An array of Notebook records + in: body + name: NotebookRequest + required: true + schema: + $ref: "#/definitions/NotebookRequest" +responses: + AccessForbidden: + description: "Access forbidden, account lacks access" + schema: + $ref: "#/definitions/Error" + AccountResponse: + description: Telnexus Response with Account objects + schema: + $ref: "#/definitions/AccountResponse" + AccountingRuleResponse: + description: Telnexus Response with Accounting Rule objects + schema: + $ref: "#/definitions/AccountingRuleResponse" + AccountingRulesetResponse: + description: Telnexus Response with Accounting Ruleset objects + schema: + $ref: "#/definitions/AccountingRulesetResponse" + AuthorityResponse: + description: An array of Authority objects + schema: + $ref: "#/definitions/AuthorityResponse" + BackendResponse: + description: Telnexus Response with Backend objects + schema: + $ref: "#/definitions/BackendResponse" + RoleResponse: + description: Telnexus Response with Role objects + schema: + $ref: "#/definitions/RoleResponse" + CashReceiptResponse: + description: Telnexus Response with Cash Receipt objects + schema: + $ref: "#/definitions/CashReceiptResponse" + ClusterResponse: + description: Telnexus Response with Cluster objects + schema: + $ref: "#/definitions/ClusterResponse" + DatabaseResponse: + description: Telnexus Response with Database objects + schema: + $ref: "#/definitions/DatabaseResponse" + TenantResponse: + description: Telnexus Response with Tenant objects + schema: + $ref: "#/definitions/TenantResponse" + CompanyResponse: + description: Telnexus Response with Company objects + schema: + $ref: "#/definitions/CompanyResponse" + Conflict: + description: Conflict + schema: + $ref: "#/definitions/Error" + ContactResponse: + description: An array of Contact objects + schema: + $ref: "#/definitions/ContactResponse" + CountryResponse: + description: Telnexus Response with an array of Country objects + schema: + $ref: "#/definitions/CountryResponse" + CountyResponse: + description: Telnexus Response with an array of County objects + schema: + $ref: "#/definitions/CountyResponse" + DeleteResponse: + description: An array of Message Objects with Delete Status + schema: + properties: + data: + items: + $ref: "#/definitions/Message" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + DomainResponse: + description: Telnexus Response with an array of Domain objects + schema: + $ref: "#/definitions/DomainResponse" + FilingResponse: + description: Telnexus Response with an array of Filing objects + schema: + $ref: "#/definitions/FilingResponse" + FilingTypeResponse: + description: Telnexus Response with an array of FilingType objects + schema: + $ref: "#/definitions/FilingTypeResponse" + GlAccountResponse: + description: An array of GL Account Objects + schema: + $ref: "#/definitions/GlAccountResponse" + GlBalanceResponse: + description: An array of GL Balance Objects + schema: + $ref: "#/definitions/GlBalanceResponse" + IngestResponse: + description: Telnexus Response with Ingest objects + schema: + $ref: "#/definitions/IngestResponse" + InvalidDataError: + description: Invalid data was sent + schema: + $ref: "#/definitions/InvalidError" + InvoiceResponse: + description: + Telnexus Response with an array of Invoice (full) objects + schema: + $ref: "#/definitions/InvoiceResponse" + JobResponse: + description: Telnexus Response with Job objects + schema: + $ref: "#/definitions/JobResponse" + LicenseResponse: + description: An array of License Objects + schema: + $ref: "#/definitions/LicenseResponse" + LicenseTypeResponse: + description: An array of License Type Objects + schema: + $ref: "#/definitions/LicenseTypeResponse" + NotFound: + description: Resource was not found + schema: + $ref: "#/definitions/Error" + OrderResponse: + description: An array of Order objects + schema: + $ref: "#/definitions/OrderResponse" + PeriodResponse: + description: Telnexus Response with Period objects + schema: + $ref: "#/definitions/PeriodResponse" + PlaceResponse: + description: Telnexus Response with an array of Place objects + schema: + $ref: "#/definitions/PlaceResponse" + ProductResponse: + description: An array of Product objects + schema: + $ref: "#/definitions/ProductResponse" + PurchaseOrderResponse: + description: An array of Purchase Order objects + schema: + $ref: "#/definitions/PurchaseOrderResponse" + QuoteResponse: + description: An array of Quote objects + schema: + $ref: "#/definitions/QuoteResponse" + ServerError: + description: Server Internal Error + schema: + $ref: "#/definitions/Error" + ServiceResponse: + description: Telnexus Response with Service objects + schema: + $ref: "#/definitions/ServiceResponse" + StateResponse: + description: Telnexus Response with an array of State objects + schema: + $ref: "#/definitions/StateResponse" + StatementResponse: + description: An array of Statement objects + schema: + $ref: "#/definitions/StatementResponse" + SubmissionResponse: + description: Telnexus Response with Submission objects + schema: + $ref: "#/definitions/SubmissionResponse" + SubscriptionResponse: + description: An array of Subscription Objects + schema: + $ref: "#/definitions/SubscriptionResponse" + TaxTransactionResponse: + description: An array of Tax Transaction Objects + schema: + $ref: "#/definitions/TaxTransactionResponse" + TaxTypeAccountResponse: + description: An array of TaxTypeAccount objects + schema: + $ref: "#/definitions/TaxTypeAccountResponse" + TaxTypeResponse: + description: Telnexus Response with an array of Tax Type objects + schema: + $ref: "#/definitions/TaxTypeResponse" + TelnexusCodeResponse: + description: + Telnexus Response with an array of Telnexus Code objects + schema: + $ref: "#/definitions/TelnexusCodeResponse" + TemplateResponse: + description: Telnexus Response with Template objects + schema: + $ref: "#/definitions/TemplateResponse" + Unauthorized: + description: "Access unauthorized, invalid API-KEY was used" + schema: + $ref: "#/definitions/Error" + UnprocessableEntity: + description: "Unprocessable Entity, likely a bad parameter" + schema: + $ref: "#/definitions/Error" + UserResponse: + description: Telnexus Response with User objects + schema: + $ref: "#/definitions/UserResponse" + NotebookResponse: + description: Telnexus Response with Notebook objects + schema: + $ref: "#/definitions/NotebookResponse" +paths: + /accountingrules: + get: + description: Return a list of Accounting Rules for an Account + operationId: getAccountingRules + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/accountIdQuery" + responses: + "200": + $ref: "#/responses/AccountingRuleResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Accounting Rules + tags: + - AccountingRules + /accountingrulesets: + get: + description: Return a list of Accounting Rulesets for an Account + operationId: getAccountingRulesets + parameters: + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/AccountingRulesetResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Accounting Rulesets + tags: + - AccountingRulesets + /accounts: + get: + description: Return a list of Accounts + operationId: getAccounts + parameters: + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/activeQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/AccountResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of accounts + tags: + - Accounts + post: + description: Account record to be added + operationId: postAccounts + parameters: + - $ref: "#/parameters/accountRequest" + responses: + "200": + $ref: "#/responses/AccountResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Add a new account to Telnexus + tags: + - Accounts + put: + description: Update a single account specified by accountId + operationId: putAccount + parameters: + - $ref: "#/parameters/accountRequest" + responses: + "200": + $ref: "#/responses/AccountResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Update a single account + tags: + - Accounts + /authorities: + get: + description: Return a list of available Authorities + operationId: getAuthorities + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/authorityIdQuery" + - $ref: "#/parameters/activeQuery" + responses: + "200": + $ref: "#/responses/AuthorityResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Authorities + tags: + - Authorities + /backends: + get: + description: Return a list of Backends + operationId: getBackends + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/backendIdQuery" + responses: + "200": + $ref: "#/responses/BackendResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Backends + tags: + - Backends + /roles: + get: + description: Return a list of Roles + operationId: getRoles + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/roleIdQuery" + responses: + "200": + $ref: "#/responses/RoleResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Roles + tags: + - Roles + /cashreceipts: + get: + description: Return a list of available Telnexus Cash Receipts + operationId: getCashReceipts + parameters: + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/activeQuery" + - $ref: "#/parameters/cashReceiptIdQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/CashReceiptResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Cash Receipts + tags: + - CashReceipts + post: + description: Create New Cash Receipts + operationId: postCashReceipts + parameters: + - in: body + name: cashReceiptRequest + schema: + $ref: "#/definitions/CashReceiptRequest" + responses: + "200": + $ref: "#/responses/CashReceiptResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Create new Cash Receipts + tags: + - CashReceipts + put: + description: Put a list of Cash Receipts + operationId: putCashRecipts + parameters: + - in: body + name: cashReceiptRequest + schema: + $ref: "#/definitions/CashReceiptRequest" + responses: + "200": + $ref: "#/responses/CashReceiptResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Put a list of Cash Receipts + tags: + - CashReceipts + /clusters: + get: + description: Return a list of Cluster records from the datastore + operationId: getClusters + parameters: + - $ref: "#/parameters/clusterIdQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/ClusterResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list Clusters + tags: + - Clusters + post: + description: Create Clusters in Telnexus + operationId: postClusters + parameters: + - $ref: "#/parameters/clusterRequest" + responses: + "200": + $ref: "#/responses/ClusterResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Create new Clusters + tags: + - Clusters + put: + description: Update Cluster in Telnexus + operationId: putClusters + parameters: + - $ref: "#/parameters/clusterRequest" + responses: + "200": + $ref: "#/responses/ClusterResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Update Clustera + tags: + - Clusters + /tenants: + get: + description: Return a list of Tenant records from the datastore + operationId: getTenants + parameters: + - $ref: "#/parameters/tenantIdQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/TenantResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list Tenants + tags: + - Tenants + post: + description: Create Tenants in Telnexus + operationId: Tenants + parameters: + - $ref: "#/parameters/tenantRequest" + responses: + "200": + $ref: "#/responses/TenantResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Create new Tenants + tags: + - Tenants + put: + description: Update Tenant in Telnexus + operationId: putTenants + parameters: + - $ref: "#/parameters/tenantRequest" + responses: + "200": + $ref: "#/responses/TenantResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Update Tenants + tags: + - Tenants + /databases: + get: + description: Return a list of Database records from the datastore + operationId: getDatabases + parameters: + - $ref: "#/parameters/databaseIdQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/DatabaseResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list Databases + tags: + - Databases + post: + description: Create Databases in Telnexus + operationId: postDatabases + parameters: + - $ref: "#/parameters/databaseRequest" + responses: + "200": + $ref: "#/responses/DatabaseResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Create new Databases + tags: + - Databases + put: + description: Update Database in Telnexus + operationId: putDatabases + parameters: + - $ref: "#/parameters/databaseRequest" + responses: + "200": + $ref: "#/responses/DatabaseResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Update Databases + tags: + - Databases + /companies: + get: + description: Retrieve a Company record from the datastore + operationId: getCompanies + parameters: + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/CompanyResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a Company record + tags: + - Companies + /contacts: + delete: + description: Delete Telnexus Contact record + operationId: deleteContact + parameters: + - $ref: "#/parameters/contactIdQuery" + responses: + "200": + $ref: "#/responses/DeleteResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Delete a Contact + tags: + - Contacts + get: + description: Return a list of all available Contacts + operationId: getContacts + parameters: + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/activeQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/contactIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/ContactResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of contacts + tags: + - Contacts + post: + description: Contact record to be added + operationId: postContacts + parameters: + - $ref: "#/parameters/contactRequest" + responses: + "200": + $ref: "#/responses/ContactResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Add new contacts + tags: + - Contacts + put: + description: Update Contact records + operationId: putContacts + parameters: + - $ref: "#/parameters/contactRequest" + responses: + "200": + $ref: "#/responses/ContactResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Update Contact + tags: + - Contacts + /counties: + get: + description: "Retrieve Counties, filter with parameters" + operationId: getCounties + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/stateQuery" + - $ref: "#/parameters/countyIdQuery" + responses: + "200": + $ref: "#/responses/CountyResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Retrieve Counties + tags: + - Counties + /countries: + get: + description: "Retrieve Countries, filter with parameters" + operationId: getCountries + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/countryIdQuery" + responses: + "200": + $ref: "#/responses/CountryResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Retrieve Countries + tags: + - Countries + /domains: + get: + description: + "Return all of the Commerce Domains in the Telnexus system. + Domains categorize general categories of commerce, such as + Merchandise, Wholesale Goods, Wholesale Trade, Services, etc." + operationId: getDomains + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/domainQuery" + - $ref: "#/parameters/domainIdQuery" + - $ref: "#/parameters/activeQuery" + responses: + "200": + $ref: "#/responses/DomainResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get Domain records + tags: + - Domains + /filings: + get: + description: Return a list of available Regulatory Filings + operationId: getFilings + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/domainQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/filingIdQuery" + - $ref: "#/parameters/activeQuery" + responses: + "200": + $ref: "#/responses/FilingResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Filings + tags: + - Filings + post: + description: Create new Filings + operationId: postFilings + parameters: + - $ref: "#/parameters/filingRequestBody" + responses: + "200": + $ref: "#/responses/FilingResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Create new Filings + tags: + - Filings + put: + description: + Update all the fields in a Filing record identified by Telnexus + ID + operationId: putFilings + parameters: + - $ref: "#/parameters/filingRequestBody" + responses: + "200": + $ref: "#/responses/FilingResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Update a Filing + tags: + - Filings + /filingtypes: + get: + description: Return a list of available Regulatory FilingTypes + operationId: getFilingTypes + parameters: + - $ref: "#/parameters/filingTypeIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/FilingTypeResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of FilingTypes + tags: + - FilingTypes + post: + description: Create new FilingTypes + operationId: postFilingTypes + parameters: + - $ref: "#/parameters/filingTypeRequest" + responses: + "200": + $ref: "#/responses/FilingTypeResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Create new FilingTypes + tags: + - FilingTypes + put: + description: + Update all the fields in a FilingType record identified by + Telnexus ID + operationId: putFilingTypes + parameters: + - $ref: "#/parameters/filingTypeRequest" + responses: + "200": + $ref: "#/responses/FilingTypeResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Update a FilingType + tags: + - FilingTypes + /glaccounts: + get: + description: Return a list of available General Ledger Accounts + operationId: getGlAccounts + parameters: + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/GlAccountResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of General Ledger Accounts + tags: + - GlAccounts + /glbalances: + get: + description: + Return a list of General Ledger Account Balances for a Telnexus + Account + operationId: getGlBalances + parameters: + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/GlBalanceResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of General Ledger Account Balances + tags: + - GlBalances + /ingests: + get: + description: Return a list of Print-Ready Ingest records + operationId: getIngests + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/accountNumberQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/ingestIdQuery" + - $ref: "#/parameters/activeQuery" + responses: + "200": + $ref: "#/responses/IngestResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list Ingests + tags: + - Ingests + post: + description: Update Ingests + operationId: postIngests + parameters: + - $ref: "#/parameters/ingestRequest" + responses: + "200": + $ref: "#/responses/IngestResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Update Ingests + tags: + - Ingests + put: + description: Update Ingests + operationId: putIngests + parameters: + - $ref: "#/parameters/ingestRequest" + responses: + "200": + $ref: "#/responses/IngestResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Update Ingests + tags: + - Ingests + /invoices: + get: + description: Return a list of available Telnexus Invoices + operationId: getInvoices + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/invoiceIdQuery" + - $ref: "#/parameters/activeQuery" + responses: + "200": + $ref: "#/responses/InvoiceResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Invoices + tags: + - Invoices + post: + description: Create New Invoices + operationId: postInvoices + parameters: + - in: body + name: invoiceRequest + schema: + $ref: "#/definitions/InvoiceRequest" + responses: + "200": + $ref: "#/responses/InvoiceResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Create a new Invoice + tags: + - Invoices + put: + description: Put a list of Invoices + operationId: putInvoices + parameters: + - in: body + name: invoiceRequest + schema: + $ref: "#/definitions/InvoiceRequest" + responses: + "200": + $ref: "#/responses/InvoiceResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Put a list of Invoices + tags: + - Invoices + /jobs: + get: + description: Return a list of Job records from the datastore + operationId: getJobs + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/accountNumberQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/jobIdQuery" + responses: + "200": + $ref: "#/responses/JobResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list Jobs + tags: + - Jobs + post: + description: Create and enqueue Jobs in Telnexus + operationId: postJobs + parameters: + - $ref: "#/parameters/jobRequest" + responses: + "200": + $ref: "#/responses/JobResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Create new Jobs + tags: + - Jobs + put: + description: Update Jobs in Telnexus + operationId: putJobs + parameters: + - $ref: "#/parameters/jobRequest" + responses: + "200": + $ref: "#/responses/JobResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Update Jobs + tags: + - Jobs + /licenses: + get: + description: "Retrieve all licenses, filter with parameters" + operationId: getLicenses + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/licenseIdQuery" + - $ref: "#/parameters/activeQuery" + responses: + "200": + $ref: "#/responses/LicenseResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Retrieve licenses + tags: + - Licenses + post: + description: Create new Licenses + operationId: postLicenses + parameters: + - description: The new licenses + in: body + name: licenseRequest + schema: + $ref: "#/definitions/LicenseRequest" + responses: + "200": + $ref: "#/responses/LicenseResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Create new Licenses + tags: + - Licenses + put: + description: Add or update licenses + operationId: putLicenses + parameters: + - description: The updated licenses + in: body + name: licenseRequest + schema: + $ref: "#/definitions/LicenseRequest" + responses: + "200": + $ref: "#/responses/LicenseResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Upsert a License + tags: + - Licenses + /licensetypes: + get: + description: Retrieve LicenseType records + operationId: getLicenseTypes + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/licenseTypeIdQuery" + - $ref: "#/parameters/activeQuery" + responses: + "200": + $ref: "#/responses/LicenseTypeResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Retrieve LicenseType records + tags: + - LicenseTypes + /orders: + get: + description: Return a list of Orders + operationId: getOrders + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/accountNumberQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/orderIdQuery" + - $ref: "#/parameters/activeQuery" + responses: + "200": + $ref: "#/responses/OrderResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Orders + tags: + - Orders + post: + description: Create new Orders + operationId: postOrders + parameters: + - in: body + name: order + schema: + $ref: "#/definitions/OrderBasicRequest" + responses: + "200": + $ref: "#/responses/OrderResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Create new Orders + tags: + - Orders + put: + description: Create new Orders + operationId: putOrders + parameters: + - in: body + name: order + schema: + $ref: "#/definitions/Order" + responses: + "200": + $ref: "#/responses/OrderResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Create new Orders + tags: + - Orders + /periods: + get: + description: Return a list of Periods for an Account + operationId: getPeriods + parameters: + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/periodIdQuery" + responses: + "200": + $ref: "#/responses/PeriodResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Periods + tags: + - Periods + /places: + get: + description: "Retrieve Places, filter with parameters" + operationId: getPlaces + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/stateQuery" + - $ref: "#/parameters/placeIdQuery" + responses: + "200": + $ref: "#/responses/PlaceResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Retrieve Places + tags: + - Places + /pos: + get: + description: Return a list of available Purchase Orders + operationId: getPos + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/poIdQuery" + - $ref: "#/parameters/activeQuery" + responses: + "200": + $ref: "#/responses/PurchaseOrderResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Purchase Orders + tags: + - PurchaseOrders + post: + description: Create New Purchase Order + operationId: postPos + parameters: + - in: body + name: purchaseOrderRequest + schema: + $ref: "#/definitions/PurchaseOrderRequest" + responses: + "200": + $ref: "#/responses/PurchaseOrderResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Create a new Purchase Order + tags: + - PurchaseOrders + put: + description: Upsert a list of Purchase Order + operationId: putPos + parameters: + - in: body + name: purchaseOrderRequest + schema: + $ref: "#/definitions/PurchaseOrderRequest" + responses: + "200": + $ref: "#/responses/PurchaseOrderResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Upsert a list of Purchase Order + tags: + - PurchaseOrders + /products: + get: + description: Return a list of all available Products + operationId: getProducts + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/productIdQuery" + - $ref: "#/parameters/activeQuery" + responses: + "200": + $ref: "#/responses/ProductResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Products + tags: + - Products + /quotes: + get: + description: Return a list of available Telnexus Quotes + operationId: getQuotes + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/accountNumberQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/quoteIdQuery" + - $ref: "#/parameters/activeQuery" + responses: + "200": + $ref: "#/responses/QuoteResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Quotes + tags: + - Quotes + post: + description: Create new Quotes + operationId: postQuotes + parameters: + - in: body + name: order + schema: + $ref: "#/definitions/Order" + responses: + "200": + $ref: "#/responses/QuoteResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Create new Quotes + tags: + - Quotes + put: + description: Update QUotes + operationId: putQuotes + parameters: + - in: body + name: order + schema: + $ref: "#/definitions/Order" + responses: + "200": + $ref: "#/responses/QuoteResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Update Quotes + tags: + - Quotes + /services: + get: + description: Return a list of Services records from the datastore + operationId: getServices + parameters: + - $ref: "#/parameters/serviceIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/ServiceResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Services + tags: + - Services + post: + description: Create Services in Telnexus + operationId: postServices + parameters: + - $ref: "#/parameters/serviceRequest" + responses: + "200": + $ref: "#/responses/ServiceResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Create new Services + tags: + - Services + put: + description: Update Services in Telnexus + operationId: putServices + parameters: + - $ref: "#/parameters/serviceRequest" + responses: + "200": + $ref: "#/responses/ServiceResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Update Services + tags: + - Services + /statements: + get: + description: Return a list of all available Statements + operationId: getStatements + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/accountNumberQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/statementIdQuery" + responses: + "200": + $ref: "#/responses/StatementResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of statements + tags: + - Statements + post: + description: + Create a new Statement for a particular Account with a Date + Range + operationId: postStatements + parameters: + - $ref: "#/parameters/statementRequestBody" + responses: + "200": + $ref: "#/responses/StatementResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Create new Statements + tags: + - Statements + /states: + get: + description: "Retrieve States, filter with parameters" + operationId: getStates + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/countryQuery" + - $ref: "#/parameters/stateIdQuery" + responses: + "200": + $ref: "#/responses/StateResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Retrieve States + tags: + - States + /submissions: + get: + description: Return a list of available Submissions + operationId: getSubmissions + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/submissionIdQuery" + - $ref: "#/parameters/activeQuery" + responses: + "200": + $ref: "#/responses/SubmissionResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Submissions + tags: + - Submissions + post: + description: Create new Sumissions + operationId: postSubmissions + parameters: + - $ref: "#/parameters/submissionRequestBody" + responses: + "200": + $ref: "#/responses/SubmissionResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Add new Submissions + tags: + - Submissions + put: + description: + Update all the fields in a Submission record identified by + Telnexus Id + operationId: putSubmissions + parameters: + - $ref: "#/parameters/submissionRequestBody" + responses: + "200": + $ref: "#/responses/SubmissionResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Update a Submission + tags: + - Submissions + /subscriptions: + get: + description: Return a list of available Subscriptions + operationId: getSubscriptions + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/subscriptionIdQuery" + - $ref: "#/parameters/activeQuery" + responses: + "200": + $ref: "#/responses/SubscriptionResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Subscriptions + tags: + - Subscriptions + post: + description: Create new Sumissions + operationId: postSubscriptions + parameters: + - $ref: "#/parameters/subscriptionRequestBody" + responses: + "200": + $ref: "#/responses/SubscriptionResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Add new Subscriptions + tags: + - Subscriptions + put: + description: + Update all the fields in a Subscription record identified by + Telnexus Id + operationId: putSubscriptions + parameters: + - $ref: "#/parameters/subscriptionRequestBody" + responses: + "200": + $ref: "#/responses/SubscriptionResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Update a Subscription + tags: + - Subscriptions + /taxnexuscodes: + get: + description: Return a list of TelnexusCodes + operationId: getTelnexusCodes + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/taxnexuscodeIdQuery" + - $ref: "#/parameters/activeQuery" + responses: + "200": + $ref: "#/responses/TelnexusCodeResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of TelnexusCodes + tags: + - TelnexusCodes + /taxtypeaccounts: + get: + description: Return a list of Tax Type Accounts + operationId: getTaxTypeAccounts + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/placeQuery" + - $ref: "#/parameters/stateQuery" + - $ref: "#/parameters/countyQuery" + - $ref: "#/parameters/countryQuery" + - $ref: "#/parameters/activeQuery" + - $ref: "#/parameters/taxTypeAccountIdQuery" + responses: + "200": + $ref: "#/responses/TaxTypeAccountResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Tax Type Accounts + tags: + - TaxTypeAccounts + post: + description: Create a new Tax Type Account + operationId: postTaxTypeAccounts + parameters: + - description: The new Tax Type Account + in: body + name: taxtypeaccount + schema: + $ref: "#/definitions/TaxTypeAccountRequest" + responses: + "200": + $ref: "#/responses/TaxTypeAccountResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Create new Tax Type Accounts + tags: + - TaxTypeAccounts + put: + description: Update a TaxTypeAccount + operationId: putTaxTypeAccounts + parameters: + - in: body + name: taxtypeaccount + schema: + $ref: "#/definitions/TaxTypeAccountRequest" + responses: + "200": + $ref: "#/responses/TaxTypeAccountResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Update TaxTypeAccounts + tags: + - TaxTypeAccounts + /taxtypes: + get: + description: + Return a complete list of all the tax types handled by Telnexus; + use the lat long parameters to retrieve a Situs lookup + operationId: getTaxTypes + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/addressQuery" + - $ref: "#/parameters/placeQuery" + - $ref: "#/parameters/stateQuery" + - $ref: "#/parameters/countyQuery" + - $ref: "#/parameters/countryQuery" + - $ref: "#/parameters/activeQuery" + - $ref: "#/parameters/taxTypeIdQuery" + responses: + "200": + $ref: "#/responses/TaxTypeResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Tax Types + tags: + - TaxTypes + /templates: + get: + description: + "Returns the PDF rendering template, or a link to where to get + the template" + operationId: getTemplates + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/templateIdQuery" + responses: + "200": + $ref: "#/responses/TemplateResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get PDF Rendering Templates + tags: + - Templates + /users: + get: + description: Return a list of User records from the datastore + operationId: getUsers + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/userIdQuery" + - $ref: "#/parameters/activeQuery" + - $ref: "#/parameters/apiKeyQuery" + responses: + "200": + $ref: "#/responses/UserResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list Users + tags: + - Users + /notebooks: + get: + description: Return a list of Notebook records from the datastore + operationId: getNotebooks + parameters: + - $ref: "#/parameters/notebookIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/NotebookResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Notebooks + tags: + - Notebooks + post: + description: Create Notebooks in Telnexus + operationId: postNotebooks + parameters: + - $ref: "#/parameters/notebookRequest" + responses: + "200": + $ref: "#/responses/NotebookResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Create new Notebooks + tags: + - Notebooks + put: + description: Update Notebooks in Telnexus + operationId: putNotebooks + parameters: + - $ref: "#/parameters/notebookRequest" + responses: + "200": + $ref: "#/responses/NotebookResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Update Notebooks + tags: + - Notebooks +definitions: + AccountingRule: + properties: + tenantid: + description: tenant identifier + type: string + id: + type: string + description: Telnexus Record Id + accountid: + type: string + description: The Account for whom this Account Rule exists + code: + type: string + description: The Code used for Accounting Rule Lookups + cogsaccountid: + type: string + description: + The Cost of Goods Sold account to be used for this Accounting + Rule + cogsaccountname: + type: string + description: COGS Account Name + createdbyid: + type: string + description: Created By + createddate: + type: string + description: Created Date + creditaccountid: + type: string + description: + The GL Account that is the Credit Account to be used in this + Accounting Rule + creditaccountname: + type: string + description: Credit Account Name + debitaccountid: + type: string + description: + The GL Account that is the Debit Account to be used in this + Accounting Rule + debitaccountname: + type: string + description: Debit Account Name + description: + type: string + description: Description + inventoryaccountid: + type: string + description: + The GL Account that is the Inventory Account to be used in + this Accounting Rule + inventoryaccountname: + type: string + description: Inventory Account Name + isdeferred: + type: boolean + description: + Is this a deferred tax, not to be charged on the invoice? + lastmodifiedbyid: + type: string + description: Last Modified By + lastmodifieddate: + type: string + description: Last Modified Date + parentfk: + type: string + description: Parent Foreign Key + proportion: + type: number + description: + The Proportion of Revenue which is governed by this Accounting + Rule; used for proportional taxing of products and services + AccountingRuleRequest: + properties: + data: + items: + $ref: "#/definitions/AccountingRule" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + AccountingRuleResponse: + properties: + data: + items: + $ref: "#/definitions/AccountingRule" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + AccountingRuleset: + type: object + properties: + tenantid: + description: tenant identifier + type: string + id: + type: string + description: Telnexus Record Id + accountid: + type: string + description: Telnexus Account ID + code: + type: string + description: Accounting Ruleset Code + createdbyid: + type: string + description: Created By + createddate: + type: string + description: Created Date + description: + type: string + description: Ruleset Description + lastmodifiedbyid: + type: string + description: Last Modified By + lastmodifieddate: + type: string + description: Last Modified Date + number: + type: string + description: Telnexus Ruleset Number + items: + items: + $ref: "#/definitions/AccountingRulesetItem" + type: array + AccountingRulesetRequest: + properties: + data: + items: + $ref: "#/definitions/AccountingRuleset" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + AccountingRulesetResponse: + properties: + data: + items: + $ref: "#/definitions/AccountingRuleset" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + AccountingRulesetItem: + type: object + properties: + tenantid: + description: tenant identifier + type: string + id: + type: string + description: Telnexus Record Id + accountingrulecode: + type: string + description: The code of the rule in this ruleset + Account: + properties: + tenantid: + description: tenant identifier + type: string + accountnumber: + description: Account Number + type: string + accountsource: + description: The marketing orgin of this account + type: string + active: + description: Active + type: boolean + administrativelevel: + description: + "For tax authorities, this account's administrative level, + e.g. Local, County, State or Federal" + type: string + amount: + description: Rollup Tax Amount + type: number + amountinvoiced: + description: Amount Invoiced + type: number + amountpaid: + description: Amount Paid + type: number + annualrevenue: + description: Annual Revenue Estimate + format: double + type: number + balance: + description: Account Balance + type: number + billingaddress: + $ref: "#/definitions/Address" + billingcontactid: + description: Contact ID + type: string + billingpreference: + description: Billing Preference + type: string + businessaddress: + $ref: "#/definitions/Address" + cannabiscustomer: + type: boolean + description: Is this a cannabis customer? + channelprogramlevelname: + description: Channel Program Level Name + type: string + channelprogramname: + description: Channel Program Name + type: string + clientenddate: + description: Client End Date + type: string + clientstartdate: + description: Client Start Date + type: string + companyid: + description: The Company ID of this Account + type: string + coordinateid: + description: The Id of the geo coordinates of this account + type: string + createdbyid: + description: Created By User ID + type: string + createddate: + description: Created Date + type: string + customerid: + description: Customer ID from source system + type: string + customerpriority: + description: Customer Priority + type: string + dandbcompanyid: + description: D-n-B Company + type: string + dba: + description: This Account's 'Doing Business As' name + type: string + defaultaddress: + $ref: "#/definitions/Address" + defaultbackendid: + description: Default Backend ID + type: string + defaultdeliverycontactid: + description: Default Delivery Address Contact ID + type: string + defaultenduserid: + description: Default End User Contact ID + type: string + description: + description: Description + type: string + dunsnumber: + description: D-U-N-S Number + type: string + ein: + description: EIN + type: string + email: + description: Main Account Email + type: string + enrollmentstatus: + description: Enrollment Status + type: string + fax: + description: Fax + type: string + id: + description: Telnexus Account Id + type: string + industry: + description: Industry + type: string + iscustomerportal: + description: Customer Portal Account + type: boolean + ispartner: + description: Partner Account + type: boolean + ispcustomer: + description: ISP Customer? + type: boolean + jigsaw: + description: Data.com Key + type: string + lastmodifiedbyid: + description: Last Modified By User ID + type: string + lastmodifieddate: + description: Last Modified Date + type: string + mspcustomer: + description: MSP Customer? + type: boolean + naicscode: + description: NAICS Code + type: string + naicsdesc: + description: NAICS Description + type: string + name: + description: Account Name + type: string + numberofemployees: + description: Employee Count Estimate + type: number + format: int64 + numberoflocations: + description: Number of Locations Estimate + type: number + format: int64 + opencharges: + description: Open Charges + type: number + ordercontactid: + description: Vendor Order Contact ID + type: string + orderemail: + description: Order Email + type: string + ownerid: + description: Account Owner User ID + type: string + ownership: + description: Ownership + type: string + parentfk: + description: Parent Foreign Key + type: string + parentid: + description: Parent Account + type: string + phone: + description: Phone + type: string + placeid: + description: + The ID of the Place situs record that applies to this Account + type: string + preparerid: + description: Tax Preparer Contact ID + type: string + rating: + description: Rating + type: string + ratingengineid: + description: Rating Engine identifier + type: string + ref: + description: External Reference ID + type: string + revenuebase: + description: Rollup Revenue Base + type: number + revenuenet: + description: Rollup Revenue Net + type: number + revenuenottaxable: + description: Rollup Revenue Not Taxable + type: number + shippingaddress: + $ref: "#/definitions/Address" + shippingcensustract: + description: Shipping Census Tract + type: string + shippingcounty: + description: Shipping County + type: string + shippingcontactid: + description: Shipping Contact ID + type: string + sic: + description: SIC Code + type: string + sicdesc: + description: SIC Description + type: string + site: + description: Account Site + type: string + status: + description: Account Status + type: string + taxexemption: + description: Tax Exemption + type: string + taxontax: + description: Rollup Tax On Tax + type: number + telecomcustomer: + description: Telecom Customer? + type: boolean + tickersymbol: + description: Ticker Symbol + type: string + tradestyle: + description: Tradestyle + type: string + type: + description: Type + type: string + unappliedpayments: + description: Unapplied Payments + type: number + unitbase: + description: Rollup Unit Base + type: number + upsellopportunity: + description: Upsell Opportunity + type: string + website: + description: Website + type: string + whmcsclientid: + description: WHMCS Client ID + type: number + format: int64 + xerocontactid: + description: Xero Contact ID + type: string + yearstarted: + description: Year Started + type: string + type: object + AccountRequest: + properties: + data: + items: + $ref: "#/definitions/Account" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + AccountResponse: + description: An array of Account objects + properties: + data: + items: + $ref: "#/definitions/Account" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Address: + properties: + city: + description: City + type: string + country: + description: Country full name + type: string + countrycode: + description: Country Code + type: string + postalcode: + description: Postal Code + type: string + state: + description: State full name + type: string + statecode: + description: State Code + type: string + street: + description: Street number and name + type: string + required: + - city + - statecode + type: object + Authority: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + description: Account + type: string + addressline1: + description: Address Line 1 + type: string + addressline2: + description: Address Line 2 + type: string + btn: + description: Billing Telephone Number + type: string + city: + description: City + type: string + contactid: + description: Contact ID + type: string + country: + type: string + createdbyid: + description: Created By User ID + type: string + createddate: + description: Created Date + type: string + date: + type: string + dateapproved: + description: Date Approved + type: string + id: + description: Telnexus Record Identifier + type: string + lastmodifiedbyid: + description: Last Modified By User ID + type: string + lastmodifieddate: + description: Last Modified Date + type: string + losingcarrier: + description: Losing Carrier + type: string + name: + description: Authority Number + type: string + nameline1: + description: Name Line 1 + type: string + nameline2: + description: Name Line 2 + type: string + opportunityid: + description: Opportunity ID + type: string + orderid: + description: Order ID + type: string + parentfk: + description: + UUID Reference the master record that owns this item + type: string + postalcode: + description: Zip Code + type: string + quoteid: + description: Quote ID + type: string + ref: + description: "Source System identifier for this record, if any" + type: string + state: + description: State + type: string + status: + description: Status + type: string + transferdate: + description: Transfer Date + type: string + type: + description: Authority Type + type: string + type: object + AuthorityRequest: + properties: + data: + items: + $ref: "#/definitions/Authority" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + AuthorityResponse: + properties: + data: + items: + $ref: "#/definitions/Authority" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Backend: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + description: The Account that owns this Backend + type: string + active: + description: Active + type: boolean + apikey: + description: apikey + type: string + applicationname: + description: Used to identify the State were required + type: string + authtype: + description: Authentication Type + type: string + backendname: + description: Backend Name + type: string + baseurl: + description: base_url + type: string + callbackurl: + description: callback_url + type: string + clientid: + description: client_id + type: string + clientsecret: + description: client_secret + type: string + companyid: + description: Company + type: string + createdbyid: + type: string + description: Created By + createddate: + type: string + description: Created Date + description: + description: Description + type: string + id: + description: Telnexus Record Id Only; not used in POST + type: string + lastmodifiedbyid: + type: string + description: Last Modified By + lastmodifieddate: + type: string + description: Last Modified Date + loginurl: + description: login_url + type: string + managementpassword: + description: Management Password + type: string + managementurl: + description: Management URL + type: string + managementusername: + description: Management Username + type: string + metrclicense: + description: MetrcLicense + type: string + metrcstate: + description: MetrcState + type: string + ownerid: + description: Ownerid + type: string + password: + description: password + type: string + production: + description: Production + type: boolean + projectid: + description: project_id + type: string + providercredentials: + description: Provider Credentials + type: string + realm: + description: realm + type: string + ref: + description: "Source System identifier for this record, if any" + type: string + resellerbackendid: + description: Resellerbackendid + type: string + securitytoken: + description: security_token + type: string + timeout: + description: Timeout + format: int64 + type: number + tokenuri: + description: token_uri + type: string + type: + description: Type + type: string + username: + description: username + type: string + vendor: + description: Backend Vendor Name + type: string + type: object + BackendRequest: + properties: + data: + items: + $ref: "#/definitions/Backend" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + BackendResponse: + properties: + data: + items: + $ref: "#/definitions/Backend" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + CashReceipt: + description: + Cash Receipt tracks all cash transactions in and out of the + enterprise + properties: + tenantid: + description: tenant identifier + type: string + accountbalance: + description: Account Balance + type: number + accountid: + description: Account + type: string + accountname: + description: Account Name + type: string + amount: + description: Amount + type: number + appliedamount: + description: Applied Amount + type: number + attempt_number: + description: Attempt Number + type: number + auditmessage: + description: Audit Trail Message + type: string + autopay: + description: Autopay? + type: boolean + billingcontactid: + description: Billing Contact + type: string + billingrunid: + description: Billing Run + type: string + createdbyid: + description: Created By + type: string + customerid: + description: Customer Id + type: string + date: + description: Journal Date + type: string + description: + description: Memo + type: string + gateway: + description: Gateway + type: string + gatewaykey: + description: Gateway Key + type: string + gatewaymessage: + description: Gateway Message + type: string + gatewaytxn: + description: GatewayTxn? + type: boolean + id: + description: Telnexus Record ID + type: string + invoiceid: + description: Invoice + type: string + isvalid: + description: Is Valid? + type: boolean + lastmodifiedbyid: + description: Last Modified By + type: string + name: + description: Payment Number + type: string + parentfk: + description: Parent Foreign Key + type: string + partneraccountid: + description: Partner Account + type: string + payment_method: + description: Payment Method + type: string + pending: + description: Pending? + type: boolean + periodid: + description: Period + type: string + picklistvalue: + description: Picklist Value + type: string + posted: + description: Posted + type: boolean + processed: + description: Processed + type: boolean + processing: + description: Processing + type: boolean + recordtypeid: + description: Record Type + type: string + ref: + description: External Reference + type: string + reference: + description: Reference + type: string + referencenumber: + description: Reference Number + type: number + rejected: + description: Rejected? + type: boolean + sourceid: + description: Source Payment Method + type: string + statementitemtype: + description: Statement Item Type + type: string + status: + description: Status + type: string + templateid: + description: Template + type: string + type: + description: Type + type: string + unappliedamount: + description: Unapplied Amount + type: number + validpayment: + description: Valid Payment? + type: boolean + xeroid: + description: Xero Credit Note Id + type: string + type: object + CashReceiptRequest: + properties: + data: + items: + $ref: "#/definitions/CashReceipt" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + CashReceiptResponse: + properties: + data: + items: + $ref: "#/definitions/CashReceipt" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Cluster: + type: object + properties: + id: + type: string + description: Telnexus Record Id + name: + type: string + description: Cluster Name + createdbyid: + type: string + description: Created By + createddate: + type: string + description: Created Date + description: + type: string + description: Description + environment: + type: string + description: Environment + ref: + type: string + description: External Reference + gateway: + type: string + description: Gateway + ip_address: + type: string + description: IP Address + lastmodifiedbyid: + type: string + description: Last Modified By + lastmodifieddate: + type: string + description: Last Modified Date + ownerid: + type: string + description: Owner + status: + type: string + description: Status + subnet: + type: string + description: Subnet + tenantid: + type: string + description: tenantid + type: + type: string + description: Type + zone: + type: string + description: Zone + ClusterRequest: + properties: + data: + items: + $ref: "#/definitions/Cluster" + type: array + meta: + $ref: "#/definitions/RequestMeta" + required: + - meta + - data + type: object + ClusterResponse: + description: An array of cluster objects + properties: + data: + items: + $ref: "#/definitions/Cluster" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Company: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + description: Telnexus ID of the Account that owns this Company + type: string + accountnumberprefix: + description: Account Number Prefix + type: string + advancedperiodid: + description: The next period to be used in periodic billing + type: string + billingaddress: + $ref: "#/definitions/Address" + billingadvice: + description: Billing Advice + type: string + billingcontactid: + description: Contact ID + type: string + billingemail: + description: Billing Email + type: string + billingphone: + description: Billing Phone + type: string + billingwebsite: + description: Billing Website + type: string + closedperiodid: + description: The last closed period + type: string + coatemplateid: + description: Chart of Accounts Template Account ID + type: string + coloraccent1: + description: Color Accent1 + type: string + coloraccent2: + description: Color Accent2 + type: string + colorprimary: + description: Color Primary + type: string + createdbyid: + description: Created By User ID + type: string + createddate: + description: Created Date + type: string + currentperiodid: + description: The current period + type: string + currentperiodstatus: + description: The current period's status value + type: string + customersuccessid: + description: User ID of default Customer Success user + type: string + dateclosed: + description: Date Closed + type: string + defaultaddress: + $ref: "#/definitions/Address" + defaultcompany: + description: Default Company? + type: boolean + fontbody: + description: Font Name for Body Text + type: string + fontheading: + description: Font Name for Heading + type: string + fontheadingnarrow: + description: Font Name for Heading Narrow + type: string + fontlink: + description: Font Names for CSS Link + type: string + fontmono: + description: Font Name for Monospace + type: string + id: + description: Telnexus Record Id + type: string + international: + description: International Customers? + type: boolean + lastaccountnumber: + description: Last Account Number + format: int64 + type: number + lastmodifiedbyid: + description: Last Modified By User ID + type: string + lastmodifieddate: + description: Last Modified Date + type: string + lasttaxtypenumber: + description: Last TaxType Number + format: int64 + type: number + logo: + description: Logo URL + type: string + name: + description: Company Name + type: string + ownerid: + description: The ID of the contact who owns this Company + type: string + preparerid: + description: User ID of the default tax preparer + type: string + pricebookid: + description: The ID of the default Pricebook for this company + type: string + usertechleadid: + description: + The ID of the contact who is the User Tech Lead for Company + type: string + type: object + CompanyResponse: + description: An array of Company objects + properties: + data: + items: + $ref: "#/definitions/Company" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Contact: + properties: + tenantid: + description: tenant identifier + type: string + id: + description: Telnexus Record Id + type: string + accountid: + description: The primary account ID of this contact + type: string + assistantname: + description: Assistant Name + type: string + assistantphone: + description: Asst. Phone + type: string + birthdate: + description: Birthdate + type: string + createdbyid: + description: Created By User ID + type: string + createddate: + description: Created Date + type: string + department: + description: Department + type: string + description: + description: Description + type: string + donotcall: + description: Do Not Call? + type: boolean + email: + description: Email address + type: string + emailbounceddate: + description: Email Bounce Date + type: string + emailbouncedreason: + description: Email Bounce Reason + type: string + enrollmentstatus: + description: Telnexus Enrollment Status + type: string + fax: + description: Fax Number + type: string + firstname: + description: First Name + type: string + hasoptedoutofemail: + description: Email Opt Out + type: boolean + hasoptedoutoffax: + description: Fax Opt Out + type: boolean + homephone: + description: Home Phone + type: string + isemailbounced: + description: Does this contact have bounced emails? + type: boolean + isprovisioned: + description: Is Provisioned? + type: boolean + lastmodifiedbyid: + description: Last Modified By User ID + type: string + lastmodifieddate: + description: Last Modified Date + type: string + lastname: + description: Last Name + type: string + leadsource: + description: Lead Source + type: string + level: + description: Level + type: string + linkedin: + description: LinkedIn Page + type: string + mailingaddress: + $ref: "#/definitions/Address" + mailinglists: + description: Mailing Lists + type: string + mobilephone: + description: Mobile Phone + type: string + name: + description: Full Name + type: string + otheraddress: + $ref: "#/definitions/Address" + otherphone: + description: Other Phone + type: string + ownerid: + description: The User ID of the user who owns this Contact + type: string + personalemail: + description: Personal Email Address for this Contact + type: string + phone: + description: Phone Number + type: string + photourl: + description: URL of a photograph of this User + type: string + recruitingstatus: + description: Recruiting Status + type: string + ref: + description: External reference to this contact, if any + type: string + reportstoid: + description: Reports To Contact ID + type: string + salutation: + description: Contact Salutation + type: string + status: + description: The Contact Status + type: string + title: + description: Contact Title + type: string + type: + description: Contact Type + type: string + type: object + ContactRequest: + properties: + data: + items: + $ref: "#/definitions/Contact" + type: array + meta: + $ref: "#/definitions/RequestMeta" + required: + - meta + - data + type: object + ContactResponse: + properties: + data: + items: + $ref: "#/definitions/Contact" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + ContractBasic: + properties: + tenantid: + description: tenant identifier + type: string + description: + description: Description + type: string + enddate: + description: Contract End Date + type: string + hourlyrate: + description: Hourly Rate + type: number + id: + description: Telnexus Record Id + type: string + isactive: + description: Is Active? + type: boolean + name: + description: Contract Name + type: string + parentfk: + description: + UUID Reference the master record that owns this item + type: string + paymentterms: + description: Payment Terms + type: string + pricebook2id: + description: Price Book + type: string + ref: + description: "Source System identifier for this record, if any" + type: string + startdate: + description: Contract Start Date + type: string + status: + description: Status + type: string + type: + description: Contract Type + type: string + type: object + Country: + properties: + accountid: + description: Account + type: string + amount: + description: Rollup Amount + type: number + format: double + code: + description: Code + type: string + latitude: + type: number + format: double + longitude: + type: number + format: double + contactid: + description: Contact + type: string + enrollmentstatus: + description: Enrollment Status + type: string + id: + description: Telnexus Record Id + type: string + interest: + description: Interest + type: number + format: double + name: + description: Country Name + type: string + penalty: + description: Penalty + type: number + format: double + ref: + description: "Source System identifier for this record, if any" + type: string + reportedadjustments: + description: Reported Adjustments + type: number + format: double + reporteddeductions: + description: Reported Deductions + type: number + format: double + reportednetrevenue: + description: Reported Net Revenue + type: number + format: double + reportedrate: + description: Reported Rate + type: number + format: double + reportedrevenue: + description: Reported Revenue + type: number + format: double + revenuebase: + description: Rollup Revenue Base + type: number + format: double + revenuenet: + description: Rollup Revenue Net + type: number + format: double + revenuenottaxable: + description: Rollup Revenue Not Taxable + type: number + format: double + status: + description: Document Status + type: string + format: double + subtotal: + description: Reported Tax + type: number + format: double + taxinstances: + items: + $ref: "#/definitions/TaxInstance" + type: array + templateid: + description: Template + type: string + totalamount: + description: Total Amount + type: number + format: double + unitbase: + description: Unit Base + type: number + type: object + CountryResponse: + description: An array of Country objects + properties: + data: + items: + $ref: "#/definitions/Country" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + County: + properties: + accountid: + description: Account + type: string + latitude: + type: number + format: double + longitude: + type: number + format: double + amount: + description: Rollup Amount + type: number + format: double + areadescription: + description: AreaDescription + type: string + contactid: + description: Contact + type: string + countryid: + description: Country Telnexus ID + type: string + enrollmentstatus: + description: Enrollment Status + type: string + fips: + description: FIPS + type: string + fipsclass: + description: FIPS Class + type: string + functionalstatus: + description: Functional Status + type: string + geocode: + description: Geocode + type: string + gnis: + description: GNIS Code + format: int64 + type: number + hasdistricttaxes: + description: True if this Place has District Sales taxes + type: boolean + id: + description: Telnexus Record Id + type: string + interest: + description: Interest + format: double + type: number + landarea: + description: Land Area + type: number + format: int64 + legalname: + description: Legal Name + type: string + name: + description: County Name + type: string + penalty: + description: Penalty + format: double + type: number + ref: + description: "Source System identifier for this record, if any" + type: string + reportedadjustments: + description: Reported Adjustments + type: number + format: double + reporteddeductions: + description: Reported Deductions + type: number + format: double + reportednetrevenue: + description: Reported Net Revenue + type: number + format: double + reportedrate: + description: Reported Rate + type: number + format: double + reportedrevenue: + description: Reported Revenue + type: number + format: double + revenuebase: + description: Rollup Revenue Base + type: number + format: double + revenuenet: + description: Rollup Revenue Net + type: number + format: double + revenuenottaxable: + description: Rollup Revenue Not Taxable + type: number + format: double + stateid: + description: State + type: string + status: + description: Document Status + type: string + subtotal: + description: Reported Tax + format: double + type: number + taxinstances: + items: + $ref: "#/definitions/TaxInstance" + type: array + templateid: + description: Print Template ID + type: string + totalamount: + description: Total Amount + format: double + type: number + totalarea: + description: Total Area + format: int64 + type: number + unitbase: + description: Unit Base + type: number + format: double + waterarea: + description: Water Area + format: int64 + type: number + type: object + CountyResponse: + description: An array of County objects + properties: + data: + items: + $ref: "#/definitions/County" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + CreditCard: + properties: + tenantid: + description: tenant identifier + type: string + active: + description: Active + type: boolean + billingcity: + description: Billing City + type: string + billingstate: + description: Billing State + type: string + billingstreet: + description: Billing Street + type: string + billingzip: + description: Billing Zip + type: string + cc_cid: + description: CC CID + type: string + cc_number: + description: CC Number + type: string + cc_print: + description: CC_Print + type: string + cc_type: + description: CC Type + type: string + companyid: + description: Company + type: string + expmonth: + description: Exp Month + type: string + expyear: + description: Exp Year + type: string + id: + description: Record Id + type: string + name: + description: CC Name + type: string + type: object + Domain: + properties: + active: + description: Active + type: boolean + description: + description: Description + type: string + id: + description: Telnexus Record Id Only; not used in POST + type: string + name: + description: Name + type: string + type: object + DomainResponse: + description: An array of Domain objects + properties: + data: + items: + $ref: "#/definitions/Domain" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Error: + properties: + code: + format: int64 + type: integer + fields: + type: string + message: + type: string + type: object + Filing: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + type: string + authorityid: + type: string + accountname: + description: Account Name on Filing + type: string + amount: + description: The amount of tax to be paid with this filing + format: double + type: number + contactid: + description: Billing Contact + type: string + createdbyid: + description: Created By User ID + type: string + createddate: + description: Created Date + type: string + date: + description: Filing Date + type: string + duedate: + description: Due Date + format: string + filingnumber: + description: Due Date + format: string + filingtypeid: + description: The ID of the Filing Type for this Filing + format: string + frequency: + description: Due Date + format: string + id: + description: Record Id + type: string + interest: + description: Interest + format: double + type: number + interestrate: + description: Interest + format: double + type: number + lastmodifiedbyid: + description: Last Modified By User ID + type: string + lastmodifieddate: + description: Last Modified Date + type: string + monthnumber: + description: The number of the Month of the filing + format: int64 + type: number + ownerid: + description: Taxneuxs ID of the User who owns this record + type: string + penalty: + description: Penalty + format: double + type: number + penaltydays: + description: Penalty Days + format: double + type: number + penaltyrate: + description: Penalty Days + format: double + type: number + periodid: + description: Period + type: string + preparerid: + description: Telnexus ID of the Contact who prepared this filing + type: string + quarternumber: + description: The number of the Month of the filing + format: int64 + type: number + ref: + description: "Source System identifier for this record, if any" + type: string + reportedadjustments: + description: Reported Adjustments + format: double + type: number + reporteddeductions: + description: Reported Deductions + format: double + type: number + reportednetrevenue: + description: Reported Net Revenue + format: double + type: number + reportedrate: + description: Reported Rate + format: double + type: number + reportedrevenue: + description: Reported Revenue + format: double + type: number + revenuebase: + description: Revenue Base + format: double + type: number + revenuenet: + description: Revenue Net + format: double + type: number + revenuenottaxable: + description: Revenue Not Taxable + format: double + type: number + semiannualnumber: + description: The number of the Month of the filing + format: int64 + type: number + status: + description: Status + type: string + submissionid: + description: Telnexus ID of the Submission that owns this Filing + type: string + subtotal: + description: Reported Tax + format: double + type: number + taxontax: + description: Tax On Tax + format: double + type: number + taxtypeaccountid: + description: + The TaxType Account for which this Filing is paying remittance + type: string + totalamount: + description: Total Amount + format: double + type: number + unitbase: + description: Unit Base + format: double + type: number + yearnumber: + description: The number of the Month of the filing + format: int64 + type: number + type: object + FilingRequest: + properties: + data: + items: + $ref: "#/definitions/Filing" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + FilingResponse: + description: An array of Filing Objects + properties: + data: + items: + $ref: "#/definitions/Filing" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + FilingDueDate: + type: object + description: Dates when this FilingType is due for filing + properties: + duedate: + type: string + description: + type: string + FilingTypeInstance: + type: object + description: A list of jurisdictions that use this Filing Type + properties: + countryid: + type: string + description: Country Id + countyid: + type: string + description: County ID + objecttype: + type: string + description: + The type of object that owns this FilingType instance + filingtypeid: + description: The ID of the Filing Type for this Filing + format: string + placeid: + type: string + description: Place ID + stateid: + type: string + description: StateID + FilingType: + type: object + description: An array of FilingType Objects + properties: + accountid: + description: Tax Authority + type: string + contactid: + description: Contact + type: string + createdbyid: + description: Created By + type: string + createddate: + description: Created Date + type: string + duedates: + items: + $ref: "#/definitions/FilingDueDate" + type: array + filingcity: + description: Filing City + type: string + filingcountry: + description: Filing Country + type: string + filingpostalcode: + description: Filing Postal Code + type: string + filingstate: + description: Filing State + type: string + filingstreet: + description: Filing Street + type: string + formname: + description: Form Name + type: string + formversion: + description: Form Version + type: string + frequency: + description: Frequency + type: string + fullname: + description: Filing Full Name + type: string + id: + description: Record Id + type: string + instances: + items: + $ref: "#/definitions/FilingTypeInstance" + type: array + lastmodifiedbyid: + description: Last Modified By + type: string + lastmodifieddate: + description: Last Modifed Date + type: string + level: + description: Jurisdictional Level + type: string + name: + description: Name + type: string + ownerid: + description: Owner + type: string + sagatype: + description: Saga Type + type: string + submissionmethod: + description: Submission Method + type: string + templateinstructionsid: + description: Instructions Template + type: string + templatereturnid: + description: Return Template + type: string + FilingTypeRequest: + properties: + data: + items: + $ref: "#/definitions/FilingType" + type: array + meta: + $ref: "#/definitions/RequestMeta" + required: + - meta + - data + type: object + FilingTypeResponse: + description: An array of Filing Objects + properties: + data: + items: + $ref: "#/definitions/FilingType" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + GlAccount: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + description: Account + type: string + accountlevel: + description: Account Level + type: number + accountname: + description: Account Name + type: string + accountnumber: + description: Account Number + type: number + accountsign: + description: Account Sign + type: string + accounttype: + description: Account Type + type: string + description: + description: Description + type: string + name: + description: Display Name + type: string + id: + description: Telnexus Record Id + type: string + isactive: + description: Is Active? + type: boolean + isbankaccount: + description: Is Bank Account ? + type: boolean + issummary: + description: Is Summary? + type: boolean + parentfk: + description: Parent Foreign Key + type: string + parentglaccountid: + description: Parent GL Account + type: string + ref: + description: Reference + type: string + status: + description: Status + type: string + type: object + GlAccountRequest: + properties: + data: + items: + $ref: "#/definitions/GlAccount" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + GlAccountResponse: + properties: + data: + items: + $ref: "#/definitions/GlAccount" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + GlBalance: + properties: + tenantid: + description: tenant identifier + type: string + accountname: + description: Account Name + type: string + amount: + description: Amount + type: number + closedate: + description: Close Date + type: string + createdbyid: + description: Created By User ID + type: string + createddate: + description: Created Date + type: string + credits: + description: Credits + type: number + debits: + description: Debits + type: number + description: + description: Description + type: string + glaccountdisplay: + description: GL Account Display Value + type: string + glaccountid: + description: GL Account + type: string + id: + description: Telnexus Record Id Only; not used in POST + type: string + lastmodifiedbyid: + description: Last Modified By User ID + type: string + lastmodifieddate: + description: Last Modified Date + type: string + periodid: + description: Period ID + type: string + ref: + description: "Source System identifier for this record, if any" + type: string + rollupcredits: + description: Rollup Credits + type: number + rollupdebits: + description: Rollup Debits + type: number + status: + description: Status + type: string + type: object + GlBalanceResponse: + properties: + data: + items: + $ref: "#/definitions/GlBalance" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Ids: + description: Telnexus Record Ids + items: + type: string + type: array + IdsRequest: + properties: + data: + items: + $ref: "#/definitions/Ids" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + Ingest: + description: A record of the Ingest of information into Telnexus + properties: + tenantid: + description: tenant identifier + type: string + accountid: + description: Account ID + type: string + amount: + description: Rollup Tax Amount + format: double + type: number + backendid: + description: Backend ID + type: string + companyid: + description: Company ID + type: string + createdbyid: + description: Telnexus User ID + type: string + createddate: + description: Date of Job Creation + type: string + description: + description: Ingest Description + type: string + enddate: + description: End Date + type: string + filename: + description: Filename + type: string + formatted: + description: Numeric and Date Values Pre-formatted as Text + properties: + amount: + type: string + ingestdate: + type: string + invoicecount: + type: string + pocount: + type: string + revenuebase: + type: string + revenuenottaxable: + type: string + unitbase: + type: string + type: object + id: + description: Record Id + type: string + ingestdate: + description: Ingest Date + type: string + ingestfailurereason: + description: Ingest Failure Reason + type: string + ingesttype: + description: Ingest Type + enum: + - fabric + - internal + - suretax + - taxnexus-api + type: string + invoicecount: + description: Invoice Count + format: int64 + type: number + jobid: + description: Job ID + type: string + lastmodifiedbyid: + description: Telnexus User ID + type: string + lastmodifieddate: + description: Last Modified Date + type: string + metrclicense: + description: License + type: string + metrcstate: + description: State Code + type: string + objecttype: + description: Ingest Object Type + enum: + - account + - cash-receipt + - contact + - invoice + - order + - po + - quote + type: string + parentfk: + description: Parent Foreign Key + type: string + periodid: + description: Period ID + type: string + pocount: + description: PO Count + format: int64 + type: number + postfailurereason: + description: Post Failure Reason + type: string + ratingengineid: + description: Rating Engine ID + type: string + ref: + description: Source System Reference + type: string + revenuebase: + description: Rollup Revenue Base + format: double + type: number + revenuenet: + description: Rollup Revenue Net + format: double + type: number + revenuenottaxable: + description: Rollup Revenue Not Taxable + format: double + type: number + sagaid: + description: + The Saga ID used to link log entries and transactions + type: string + sagatype: + description: The type of Saga transaction being performed + type: string + source: + description: The source system that generated this job + type: string + startdate: + description: Start Date + type: string + status: + description: Ingest Status + enum: + - failed_accounting + - failed_existing + - failed_glpost + - failed_invoice + - failed_po + - ingested + - new + - posted + - queued + - rated + - rejected + type: string + taxtransactioncount: + description: Tax Transaction Count + format: int64 + type: number + templateid: + description: Template + type: string + unitbase: + description: Rollup Unit Base + format: int64 + type: number + required: + - accountid + - objecttype + type: object + IngestRequest: + properties: + data: + items: + $ref: "#/definitions/Ingest" + type: array + meta: + $ref: "#/definitions/RequestMeta" + required: + - meta + - data + type: object + IngestResponse: + description: An array of Print-Ready ingest Objects + properties: + data: + items: + $ref: "#/definitions/Ingest" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + InvalidError: + allOf: + - $ref: "#/definitions/Error" + - properties: + details: + items: + type: string + type: array + type: object + Invoice: + properties: + tenantid: + description: tenant identifier + type: string + accountbalance: + description: Account Balance + format: double + type: number + accountid: + description: Account + type: string + accountname: + description: Account Name + type: string + advance: + description: Advance? + type: boolean + amount: + description: Invoice Amount + format: double + type: number + amount_adjustment: + description: Amount Adjustment + format: double + type: number + amountdue: + description: Amount Due + format: double + type: number + amountpaid: + description: Amount Paid + format: double + type: number + auditmessage: + description: Audit Trail Message + type: string + billingcity: + description: Billing City + type: string + billingcountry: + description: Billing Country + type: string + billingpostalcode: + description: Billing Postal Code + type: string + billingrunid: + description: Billing Run + type: string + billingstate: + description: Billing State + type: string + billingstreet: + description: Billing Street + type: string + billtocontactid: + type: string + cannabistax: + description: Cannabis Tax + format: double + type: number + contractid: + description: Contract + type: string + coordinate: + $ref: "#/definitions/Address" + customerid: + description: Customer ID + type: string + dateissued: + description: Date Issued + type: string + daysdue: + description: Days Due + format: double + type: number + depositamount: + description: Deposit Amount + format: double + type: number + description: + description: Description + type: string + discount: + description: Discount + format: double + type: number + id: + description: Telnexus Record Id Only; not used in POST + type: string + invoicedate: + description: Invoice Date + type: string + invoicenumber: + description: Invoice Number + type: string + isinternational: + description: Is International? + type: boolean + issuedaccountbalance: + description: Issued Account Balance + format: double + type: number + issuedamountdue: + description: Issued Amount Due + format: double + type: number + issuedbyid: + description: Issued By + type: string + isvalid: + description: Is Valid? + type: boolean + items: + description: The items associated with this Invoice + items: + $ref: "#/definitions/InvoiceItem" + type: array + lineitemcount: + description: Line Item Count + format: int64 + type: number + minimumpaymentdue: + description: Minimum Payment Due + format: double + type: number + monthlyamount: + description: Monthly Amount + format: double + type: number + opportunityid: + description: Opportunity + type: string + orderid: + description: Order + type: string + overdue0: + description: Overdue0 + format: double + type: number + overdue120: + description: Overdue 120 Days Amount + format: double + type: number + overdue30: + description: Overdue 30 Days Amount + format: double + type: number + overdue45: + description: Overdue 45 Days Amount + format: double + type: number + overdue60: + description: Overdue 60 Days Amount + format: double + type: number + overdue90: + description: Overdue 90 Days Amount + format: double + type: number + parentfk: + description: + UUID Reference the master record that owns this item + type: string + partneraccountid: + description: Partner Account + type: string + payment_method: + description: Payment Method + type: string + paymentdue: + description: Payment Due + type: string + paymentmethodid: + description: Payment Method + type: string + paymentterms: + description: Payment Terms + type: string + periodid: + description: Period + type: string + picklistvalue: + description: Picklist Value + type: string + posted: + description: Posted + type: boolean + prioraccountbalance: + description: Prior Account Balance + format: double + type: number + prioradjustments: + description: Prior Adjustments + format: double + type: number + priorinvoiceamount: + description: Prior Invoice Amount + format: double + type: number + priorinvoicedate: + description: Prior Invoice Date + type: string + priorinvoiceid: + description: Prior Invoice + type: string + priorpaymentamount: + description: Prior Payment Amount + format: double + type: number + priorpaymentdate: + description: Prior Payment Date + type: string + priorpaymentid: + description: Prior Payment + type: string + priorpaymentmemo: + description: Prior Payment Memo + type: string + prorated: + description: Prorated? + type: boolean + prorateddays: + description: Prorated Days + format: double + type: number + purchaseamount: + description: Purchase Amount + format: double + type: number + quoteid: + description: Quote + type: string + ratingingestid: + description: Rating Ingest + type: string + ref: + description: "Source System identifier for this record, if any" + type: string + reference: + description: Reference + type: string + salesregulation: + description: Sales Regulation Type (Medicinal or Recreational) + type: string + salestax: + description: Sales Tax + format: double + type: number + scheduledpaymentdate: + description: Scheduled Payment Date + type: string + service_term: + description: Service Term + type: string + shippingcity: + description: Shipping City + type: string + shippingcountry: + description: Shipping Country + type: string + shippinghandling: + description: Shipping & Handling + format: double + type: number + shippingpostalcode: + description: Shipping Postal Code + type: string + shippingstate: + description: Shipping State + type: string + shippingstreet: + description: Shipping Street + type: string + statementitemtype: + description: Statement Item Type + type: string + status: + description: Status + type: string + subtotal: + description: Subtotal + format: double + type: number + suppressworkflow: + description: Suppress Workflow? + type: boolean + taxitems: + description: The taxes associated with this Invoice + items: + $ref: "#/definitions/TaxTransaction" + type: array + telecomtax: + description: Telecom Tax + format: double + type: number + templateid: + description: Template + type: string + type: + description: Type + type: string + whmcsclientid: + description: WHMCS Client ID + type: string + whmcsinvoiceid: + description: WHMCS Invoice ID + type: string + xeroid: + description: Xero Invoice Id + type: string + year: + description: Year + format: int64 + type: number + type: object + InvoiceBasic: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + description: + Account Identifier from Source System; ignored in tax + calculations + type: string + amount: + description: Invoice Amount; ignored in tax calculation + format: double + type: number + amountdue: + description: Amount Due; ignored in tax calculations + format: double + type: number + coordinate: + $ref: "#/definitions/Address" + id: + description: Telnexus Record Id Only; not used in POST + type: string + invoicedate: + description: + Invoice Date; should be date only or correct time zone if in + time notation + type: string + invoicenumber: + description: + Source System Customer-Facing Invoice Number; ignored in tax + calculation + type: string + items: + description: The items associated with this Invoice + items: + $ref: "#/definitions/ItemBasic" + type: array + parentfk: + description: + UUID Reference the master record that owns this item + type: string + ref: + description: "Source System identifier for this record, if any" + type: string + salesregulation: + description: Sales Regulation Type + type: string + status: + description: + Status used by for Billing Balances; ignored in tax + calculation + enum: + - closed + - delivered + - hold + - issued + - new + - posted + - rated + - rating_failed + - rating_ready + - reissued + - rendered + - uncollectable + - voided + type: string + subtotal: + description: Subtotal + format: double + type: number + type: + description: Invoice Type + type: string + type: object + InvoiceItem: + properties: + tenantid: + description: tenant identifier + type: string + census_tract: + description: Census Tract + type: string + cogs: + description: Cost of Goods Sold + type: number + format: double + contractid: + description: Contract Number + type: string + countyid: + description: County + type: string + description: + description: Line Item Description + type: string + exportdescription: + description: Export Description + type: string + family: + description: Family + type: string + id: + description: Telnexus Record Id Only; not used in POST + type: string + invoiceid: + description: Invoice + type: string + linenumber: + description: Line + format: int64 + type: number + list_price: + description: List Price + type: number + locationid: + description: Location + type: string + orderitemid: + description: Order Item + type: string + parentfk: + description: + UUID Reference the master record that owns this item + type: string + periodid: + description: Period + type: string + productcode: + description: Product Code + type: string + productid: + description: Product + type: string + quantity: + description: Quantity + format: double + type: number + quotelineitemid: + description: Quote Line Item + type: string + ref: + description: "Source System identifier for this record, if any" + type: string + rejected_quantity: + description: Rejected Quantity + format: double + type: number + revenueaccount: + description: Revenue Account + type: number + seq: + description: Seq + type: string + shipped_quantity: + description: Shipped Quantity + type: number + shippinghandling: + description: Shipping & Handling + type: number + sku: + description: SKU + type: string + subscriptionid: + description: Subscription + type: string + subtotal: + description: Subtotal + type: number + taxnexuscode: + description: Telnexus Code + type: string + totalprice: + description: Total Price + type: number + unitprice: + description: Unit Price + type: number + type: object + InvoiceRequest: + properties: + data: + items: + $ref: "#/definitions/InvoiceBasic" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + InvoiceResponse: + properties: + data: + items: + $ref: "#/definitions/Invoice" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + ItemBasic: + properties: + description: + description: Line Item Description + type: string + cogs: + description: Cost of Goods Sold + type: number + format: double + id: + description: Telnexus Record Id Only; not used in POST + type: string + invoiceid: + description: Source System Parent Foreign Key to Invoice + type: string + parentfk: + description: + UUID Reference the master record that owns this item + type: string + productcode: + description: Product Code + type: string + quantity: + description: Quantity + format: double + type: number + ref: + description: "Source System identifier for this record, if any" + type: string + salesregulation: + description: Sales Regulation Type + type: string + shippinghandling: + description: Shipping & Handling and Delivery Fees for this Item + format: double + type: number + subtotal: + description: Subtotal + format: double + type: number + taxnexuscode: + description: Telnexus Code + type: string + unitprice: + description: Unit Price + format: double + type: number + units: + description: The Unit of Measure for this item + enum: + - each + - month + - day + - week + - hour + - oz_drywt_flower + - oz_drywt_leaves + - oz_fresh + - gm + - oz + - lb + type: string + required: + - quantity + - unitprice + - taxnexuscode + - ref + type: object + Job: + properties: + accountid: + description: Telnexus Account Id + type: string + backendid: + description: Telnexus Backend ID + type: string + companyid: + description: Telnexus Company ID + type: string + coordinateid: + description: Telnexus Coordinate ID + type: string + createdbyid: + description: Telnexus User ID + type: string + createddate: + description: Date of Job Creation + type: string + month: + type: number + format: int64 + quarter: + type: number + format: int64 + semiannual: + type: number + format: int64 + year: + type: number + format: int64 + duration: + description: + The amount of time after the Start Time to perform one or more + jobs + enum: + - day + - document + - hour + - minute + - month + - quarter + - second + - week + - year + type: string + enddate: + description: End Date/Time + type: string + errorreason: + description: Error Reason + type: string + id: + description: Telnexus Record Id of the Job record + type: string + interval: + description: + The time interval by which multiple jobs are executed within + the Duration + enum: + - day + - each + - hour + - minute + - month + - quarter + - second + - week + - year + type: string + jobdate: + description: Job Date + type: string + lastmodifiedbyid: + description: Last Modified By + type: string + lastmodifieddate: + description: Last Modified Date + type: string + nextjobid: + description: Next Job + type: string + objecttype: + description: Object Type + enum: + - invoice + - order + - po + - quote + type: string + ownerid: + description: The user ID that owns this job + type: string + parameters: + description: Any parameters needed to process the job + type: string + periodid: + description: Period + type: string + ratingengineid: + description: Rating Engine + type: string + ref: + description: External Reference + type: string + reschedule: + description: Reschedule? + type: boolean + rescheduleinterval: + description: Reschedule Interval + format: int64 + type: number + sagaid: + description: + The Saga ID used to link log entries and transactions + type: string + sagatype: + description: The type of Saga transaction being performed + enum: + - newGLPostInvoices + - newIngestInvoice + - newIngestPO + type: string + source: + description: The source system that generated this job + enum: + - api + - fabric + - taxnexus + - telnexus + type: string + startdate: + description: Start Date/Time + type: string + status: + description: Status + enum: + - active + - complete + - error + - new + - queued + type: string + target: + description: The target system that executes this job + enum: + - api + - fabric + - taxnexus + - telnexus + type: string + type: + description: Type + enum: + - coordinate + - email + - ingest + - tax + type: string + type: object + JobRequest: + properties: + data: + items: + $ref: "#/definitions/Job" + type: array + meta: + $ref: "#/definitions/RequestMeta" + required: + - meta + - data + type: object + JobResponse: + description: An array of Print-Ready ingest Objects + properties: + data: + items: + $ref: "#/definitions/Job" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + License: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + type: string + backendid: + type: string + contactid: + type: string + createdbyid: + type: string + createddate: + type: string + dateissued: + description: Date + type: string + expirationdate: + description: Expiration Date + type: string + id: + description: Telnexus Record Id Only; not used in POST + type: string + iscanceled: + description: Is Canceled? + type: boolean + isrevoked: + description: Is Revoked? + type: boolean + lastmodifiedbyid: + type: string + lastmodifieddate: + type: string + licensetypeid: + description: License Type Number + type: string + licensenumber: + description: License Number + type: string + ref: + description: "Source System identifier for this record, if any" + type: string + status: + description: Status + type: string + type: object + LicenseRequest: + properties: + data: + items: + $ref: "#/definitions/License" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + LicenseResponse: + properties: + data: + items: + $ref: "#/definitions/License" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + LicenseType: + properties: + accountid: + type: string + agentid: + type: string + contactid: + type: string + cost: + description: Cost + type: number + format: double + createdbyid: + type: string + createddate: + type: string + domainid: + type: string + frequency: + description: Frequency + type: string + id: + description: Telnexus Record Id + type: string + lastmodifiedbyid: + type: string + lastmodifieddate: + type: string + level: + description: Level + type: string + name: + description: License Type Name + type: string + picklistvalue: + description: Picklist Value + type: string + ref: + description: "Source System identifier for this record, if any" + type: string + restriction: + description: Restriction + type: string + tier: + description: Tier + type: string + domains: + type: array + items: + type: string + jurisdictions: + type: array + items: + $ref: "#/definitions/GeoLicenseTypeInstance" + type: object + GeoLicenseTypeInstance: + description: Links a license type to a geography + type: object + properties: + objecttype: + type: string + placeid: + type: string + countyid: + type: string + stateid: + type: string + countryid: + type: string + LicenseTypeResponse: + properties: + data: + items: + $ref: "#/definitions/LicenseType" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Message: + properties: + message: + type: string + ref: + type: string + status: + type: integer + type: object + Order: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + type: string + accountnumber: + description: Account Number + type: string + activatedbyid: + description: Activated By + type: string + activateddate: + description: Activated Date + type: string + amount: + description: Order Amount + format: double + type: number + billingaddress: + $ref: "#/definitions/Address" + billingcontactid: + type: string + billingtype: + description: Billing Type + type: string + billtocontactid: + description: Bill To Contact + type: string + cannabistax: + description: Cannabis Tax + format: double + type: number + companyauthorizedbyid: + description: Company Authorized By + type: string + companyauthorizeddate: + description: Company Authorized Date + type: string + completion: + description: Completion Status + type: string + contract: + $ref: "#/definitions/ContractBasic" + contractenddate: + description: Contract End Date + type: string + contractid: + description: Contract Number + type: string + contractname: + description: Contract Name + type: string + coordinate: + $ref: "#/definitions/Address" + customerauthorizedbyid: + description: Customer Authorized By + type: string + customerauthorizeddate: + description: Customer Authorized Date + type: string + description: + description: Description + type: string + effectivedate: + description: Order Start Date + type: string + enddate: + description: Order End Date + type: string + enduserid: + type: string + id: + description: Telnexus Record Id Only; not used in POST + type: string + installationdate: + description: Installation Date + type: string + invoice: + description: Invoice + type: string + isreductionorder: + description: Reduction Order + type: boolean + items: + description: The Order Items + items: + $ref: "#/definitions/OrderItem" + type: array + lineitemcount: + description: Line Item Count + format: int64 + type: number + monthlyamount: + description: Monthly Amount + type: number + name: + description: Order Name + type: string + open: + description: Open Order? + type: boolean + opportunityid: + description: Opportunity + type: string + ordernumber: + description: Order Number + type: string + orderreferencenumber: + description: Order Reference Number + type: string + originalorderid: + description: Original Order + type: string + ownerid: + description: Order Owner + type: string + parentfk: + description: + UUID Reference the master record that owns this item + type: string + paymentmethodid: + description: Payment Method + type: string + paymentterms: + description: Payment Terms + type: string + podate: + description: PO Date + type: string + ponumber: + description: PO Number + type: string + provisioningstatus: + description: Provisioning Status + type: string + purchaseamount: + description: Purchase Amount + type: number + quoteid: + description: Quote + type: string + recordtypeid: + description: Order Record Type + type: string + ref: + description: "Source System identifier for this record, if any" + type: string + salesregulation: + description: Sales Regulation Type + type: string + salestax: + description: Sales Tax + format: double + type: number + serviceterm: + description: Service Term + type: string + shippingaddress: + $ref: "#/definitions/Address" + shippingcontactid: + type: string + shippinghandling: + description: Shipping & Handling + type: number + shiptocontactid: + description: Ship To Contact + type: string + status: + description: Status + type: string + subtotal: + description: Subtotal + format: double + type: number + taxitems: + description: The taxes associated with this Order + items: + $ref: "#/definitions/TaxTransaction" + type: array + telecomtax: + description: Telecom Tax + format: double + type: number + templateid: + description: Template + type: string + totalamount: + description: Order Amount + format: int64 + type: number + type: + description: Order Type + type: string + type: object + OrderBasic: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + description: Account + type: string + amount: + description: Order Amount + format: double + type: number + amountdue: + description: Amount Due + format: double + type: number + coordinate: + $ref: "#/definitions/Address" + id: + description: Telnexus Record Id Only; not used in POST + type: string + items: + $ref: "#/definitions/ItemBasic" + orderdate: + description: Order Date + type: string + parentfk: + description: + UUID Reference the master record that owns this item + type: string + ref: + description: "Source System identifier for this record, if any" + type: string + salesregulation: + description: Sales Regulation Type (Medicinal or Recreational) + type: string + status: + description: Status + type: string + subtotal: + description: Subtotal + format: double + type: number + type: + description: Type + type: string + type: object + OrderBasicRequest: + properties: + data: + items: + $ref: "#/definitions/OrderBasic" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + OrderItem: + properties: + tenantid: + description: tenant identifier + type: string + account: + description: Account + type: object + activated: + description: Activated? + type: boolean + activatedby: + description: Activated By + type: string + availablequantity: + description: Available Quantity + format: double + type: number + contractid: + description: Contract Number + type: string + createreservation: + description: Create Reservation? + type: boolean + datedelivered: + description: Date Delivered + type: string + dateordered: + description: Date Ordered + type: string + datepromised: + description: Date Promised + type: string + description: + description: Line Description + type: string + discount: + description: Discount + format: double + type: number + enddate: + description: End Date + type: string + family: + description: Family + type: string + id: + description: Telnexus Record Id Only; not used in POST + type: string + inventorytracking: + description: Inventory Tracking + type: boolean + invoiceitemid: + description: Invoice Item + type: string + linegrossamount: + description: Line Gross Amount + format: double + type: number + lineitemnumber: + description: Line Item Number + format: int64 + type: number + listprice: + description: List Price + format: double + type: number + locationid: + description: Location + type: string + orderid: + description: Order + type: string + orderitemnumber: + description: Order Product Number + type: string + originalorderitemid: + description: Original Order Product + type: string + parentfk: + description: + UUID Reference the master record that owns this item + type: string + posted: + description: Posted? + type: boolean + product2id: + description: Product + type: string + productid: + description: ProductId + type: string + productname: + description: Product Name + type: string + quantity: + description: Quantity + format: double + type: number + quantityonhand: + description: Quantity On Hand + format: double + type: number + quotelineitemid: + description: Quote Line Item + type: string + ref: + description: "Source System identifier for this record, if any" + type: string + servicedate: + description: Start Date + type: string + shippinghandling: + description: Shipping & Handling + format: double + type: number + status: + description: Status + type: string + subscriptionid: + description: Subscription + type: string + subtotal: + description: Subtotal + format: double + type: number + taxnexuscodeid: + description: Telnexus Code + type: string + totalprice: + description: Total Price + format: double + type: number + unitprice: + description: Unit Price + format: double + type: number + type: object + OrderResponse: + description: An array of Order Objects + properties: + data: + items: + $ref: "#/definitions/Order" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Pagination: + properties: + NextLink: + type: string + PLimit: + format: int64 + type: integer + POffset: + format: int64 + type: integer + PageSize: + format: int64 + type: integer + SetSize: + format: int64 + type: integer + type: object + Period: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + description: Account that owns this Period + type: string + companyid: + description: Company + type: string + days: + description: Days + format: int64 + type: number + enddate: + description: End Date + type: string + id: + description: Telnexus Record Id + type: string + month: + description: Month number + format: int64 + type: number + name: + description: Period Name + type: string + quarter: + description: Quarter number + format: int64 + type: number + ref: + description: "Source System identifier for this record, if any" + type: string + semiannual: + description: Semiannual number + format: int64 + type: number + startdate: + description: Start Date + type: string + status: + description: Status + type: string + year: + description: Year number + format: int64 + type: number + type: object + PeriodRequest: + properties: + data: + items: + $ref: "#/definitions/Period" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + PeriodResponse: + description: An array of Period objects + properties: + data: + items: + $ref: "#/definitions/Period" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Place: + properties: + accountid: + description: Account + type: string + accountvalidation: + description: Account Validation + type: string + amount: + description: Rollup Amount + format: double + type: number + latitude: + type: number + format: double + longitude: + type: number + format: double + areadescription: + description: AreaDescription + type: string + contactid: + description: Contact + type: string + countryid: + description: Telnexus ID of the Country this places is in + type: string + countyid: + description: County + type: string + enrollmentstatus: + description: Enrollment Status + type: string + fips: + description: FIPS + type: string + fipsclass: + description: FIPS Class + type: string + functionalstatus: + description: Functional Status + type: string + geocode: + description: Geocode + type: string + gnis: + description: GNIS + format: int64 + type: number + hasdistricttaxes: + description: True if this Place has District Sales taxes + type: boolean + id: + description: Salesforce Record Id + type: string + interest: + description: Interest + format: double + type: number + landarea: + description: Land Area + format: int64 + type: number + legalname: + description: Legal Name + type: string + name: + description: Place Name + type: string + penalty: + description: Penalty + format: double + type: number + polygoncentroid: + description: Polygon Centroid + type: object + ref: + description: External reference if any + type: string + reportedadjustments: + description: Reported Adjustments + type: number + format: double + reporteddeductions: + description: Reported Deductions + type: number + format: double + reportednetrevenue: + description: Reported Net Revenue + type: number + format: double + reportedrate: + description: Reported Rate + type: number + format: double + reportedrevenue: + description: Reported Revenue + type: number + format: double + revenuebase: + description: Rollup Revenue Base + type: number + format: double + revenuenet: + description: Rollup Revenue Net + type: number + format: double + revenuenottaxable: + description: Rollup Revenue Not Taxable + type: number + format: double + stateid: + description: State + type: string + status: + description: Document Status + type: string + subtotal: + description: Reported Tax + format: double + type: number + taxinstances: + items: + $ref: "#/definitions/TaxInstance" + type: array + templateid: + description: Template + type: string + totalamount: + description: Total Amount + format: double + type: number + totalarea: + description: Total Area + format: int64 + type: number + unitbase: + description: Unit Base + type: number + waterarea: + description: Water Area + format: int64 + type: number + type: object + PlaceResponse: + properties: + data: + items: + $ref: "#/definitions/Place" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Pricebook: + properties: + tenantid: + description: tenant identifier + type: string + description: + description: Description + type: string + id: + description: Telnexus Record Id + type: string + isactive: + description: Active + type: boolean + isstandard: + description: Is Standard Price Book + type: boolean + name: + description: Price Book Name + type: string + type: object + PricebookEntry: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + description: Active + type: string + agentid: + description: Created By + type: string + id: + description: Record Id + type: string + pricebook: + $ref: "#/definitions/Pricebook" + procuct: + $ref: "#/definitions/Product" + productcode: + description: Product Code + type: string + unitprice: + description: List Price + format: double + type: number + usestandardprice: + description: Use Standard Price + type: boolean + type: object + Product: + properties: + AccountID: + description: The ID of the Account that owns this product + type: string + AgencyType: + description: Agency Type + type: string + AssetTracking: + description: Asset Tracking? + type: boolean + CreatedByID: + description: ID of who created this record instance + type: string + CreatedDate: + description: Date of record creation + type: string + Description: + description: Product Description + type: string + DescriptionSKU: + description: DescriptionSKU + type: string + DisplayURL: + description: Display URL + type: string + Family: + description: Product Family + type: string + ID: + description: Telnexus Record Id + type: string + Image500: + description: Image (500) + type: string + ImageFull: + description: Image (Full) + type: string + InventoryTracking: + description: Inventory Tracking? + type: boolean + IsActive: + description: Active + type: boolean + IsGeneric: + description: isGeneric + type: boolean + LastModifiedByID: + description: Last modified by ID + type: string + LastModfiedDate: + type: string + description: Last Modified Date + Manufacturer: + description: Manufacturer + type: string + ManufacturerProductCode: + description: Manufacturer Product Code + type: string + MRCInterval: + description: MRC Interval + format: int64 + type: number + MSRP: + description: MSRP + format: double + type: number + Name: + description: Product Name + type: string + ProductCode: + description: Product Code + type: string + Prorateable: + description: Prorateable? + type: boolean + Publish: + description: Publish? + type: boolean + PublishUPC: + description: Publish UPC + type: string + QuantityUnitOfMeasure: + description: Quantity Unit Of Measure + type: string + Refundable: + description: Refundable? + type: boolean + ShippingWeight: + description: Shipping Weight + format: double + type: number + SKU: + description: SKU + type: string + Specifications: + description: Specifications + type: string + TelnexusCodeID: + description: Telnexus Code + type: string + TelnexusCode: + description: Telnexus Code Name + type: string + TenantID: + description: tenant identifier + type: string + Units: + description: Units + type: string + VendorID: + description: Vendor + type: string + VendorName: + description: Vendor Name + type: string + VendorPartNumber: + description: Vendor Part Number + type: string + VendorPrice: + description: Vendor Price + format: double + type: number + type: object + ProductRequest: + properties: + data: + items: + $ref: "#/definitions/Product" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + ProductResponse: + properties: + data: + items: + $ref: "#/definitions/Product" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + PurchaseOrder: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + type: string + creditcardid: + type: string + date_expires: + description: Date Expires + type: string + date_promised: + description: Date Promised + type: string + date_requested: + description: Date Requested + type: string + description: + description: Description + type: string + duedate: + description: Due Date + type: string + enduserid: + type: string + grand_total: + description: Grand Total + format: double + type: number + id: + description: Telnexus Record Id + type: string + items: + items: + $ref: "#/definitions/PurchaseOrderItem" + type: array + lineitemcount: + description: Line Item Count + format: int64 + type: number + opportunityid: + description: Opportunity Name + type: string + orderid: + description: Order Number + type: string + parentfk: + description: The record identifier from the source system + type: string + paymentterms: + description: Payment Terms + type: string + podate: + description: Date + type: string + ponumber: + description: Number + type: string + posted: + description: Posted + type: boolean + quoteid: + description: Quote Name + type: string + sales_tax: + description: Addl Tax + format: double + type: number + salesregulation: + description: Sales Regulation Type (Medicinal or Recreational) + type: string + service_term: + description: Service Term + type: string + ship_date: + description: Ship Date + type: string + shipping_country: + description: Shipping Country + type: string + shipping_special_instructions: + description: Shipping Special Instructions + type: string + shippingaddress: + description: Shipping Address + type: string + shippingcity: + description: Shipping City + type: string + shippingcontactid: + type: string + shippinghandling: + description: Shipping & Handling + format: double + type: number + shippingpostalcode: + description: Shipping Postal Code + type: string + shippingstate: + description: Shipping State + type: string + shippingstreet: + description: Shipping Street + type: string + status: + description: Status + type: string + subtotal: + description: Subtotal + format: double + type: number + taxable: + description: Taxable? + type: string + taxitems: + description: The taxes associated with this Purchase Order + items: + $ref: "#/definitions/TaxTransaction" + type: array + totalprice: + description: Total Price + format: double + type: number + type: + description: Type + type: string + vendorid: + type: string + vendorquotenumber: + description: Vendor Quote Number + type: string + type: object + PurchaseOrderBasic: + properties: + accountid: + description: Account + type: string + amount: + description: Purchase Order Amount + type: number + amountdue: + description: Amount Due + format: double + type: number + coordinate: + $ref: "#/definitions/Address" + id: + description: Order Id + type: string + items: + items: + $ref: "#/definitions/ItemBasic" + type: array + podate: + description: Purcahse Order Date + type: string + ponumber: + description: Purchase Order Number + type: string + salesregulation: + description: Sales Regulation Type (Medicinal or Recreational) + type: string + status: + description: Status + type: string + subtotal: + description: Subtotal + format: double + type: number + type: + description: Type + type: string + type: object + PurchaseOrderItem: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + description: Account + type: string + description: + description: Line Item Description + type: string + due_date: + description: Due Date + type: string + enduserid: + description: End User + type: string + id: + description: Record Id + type: string + linenumber: + description: Line + format: int64 + type: number + locationid: + description: Location + type: string + orderitemid: + description: Order Item + type: string + parentfk: + description: + The record identifier of the parent record from the source + system + type: string + partneraccountid: + description: Partner Account + type: string + posted: + description: Posted + type: boolean + pricebookentryid: + description: PricebookEntryID + type: string + product: + description: Product + type: object + productcode: + description: Product Code + type: string + purchaseorderid: + description: Purchase Order + type: string + quantity: + description: Quantity + format: double + type: number + quotelineitemid: + description: Quote Item + type: string + received_qty: + description: Received Qty + format: double + type: number + rejected_qty: + description: Rejected Qty + format: double + type: number + seq: + description: Record ID Name + type: string + shipmentitmeid: + description: Shipment Item + type: string + status: + description: Status + type: string + stocked_qty: + description: Stocked Qty + format: double + type: number + subtotal: + description: Subtotal + format: double + type: number + taxable: + description: Taxable? + type: string + taxnexuscode: + description: Telnexus Code + type: string + totalprice: + description: Total Price + format: double + type: number + unitprice: + description: Unit Price + format: double + type: number + type: object + PurchaseOrderRequest: + properties: + data: + items: + $ref: "#/definitions/PurchaseOrder" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + PurchaseOrderResponse: + description: An array of Purchase Order Objects + properties: + data: + items: + $ref: "#/definitions/PurchaseOrder" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Quote: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + type: string + additionaladdress: + description: Additional To + type: object + additionalname: + description: Additional To Name + type: string + billingaddress: + description: Bill To + type: object + billingcontactid: + type: string + billingname: + description: Bill To Name + type: string + cannabistax: + description: Cannabis Tax + format: double + type: number + contactid: + type: string + contractid: + type: string + coordinateid: + type: string + creditterms: + description: Credit Terms + type: string + date: + description: Quote Date + type: string + description: + description: Description + type: string + discount: + description: Discount + format: double + type: number + discountamount: + description: Discount Amount + format: double + type: number + email: + description: Email + type: string + enduserid: + type: string + expirationdate: + description: Expiration Date + type: string + fax: + description: Fax + type: string + grandtotal: + description: Grand Total + format: double + type: number + id: + description: Telnexus Record Id Only; not used in POST + type: string + installationdate: + description: Installation Date + type: string + issyncing: + description: Syncing + type: boolean + items: + items: + $ref: "#/definitions/QuoteItem" + type: array + lineitemcount: + description: Line Items + format: int64 + type: number + monthlyamount: + description: Monthly Amount + format: double + type: number + name: + description: Quote Name + type: string + opportunityid: + description: Opportunity Name + type: string + ownerid: + description: Owner Name + type: string + parentfk: + description: + UUID Reference the master record that owns this item + type: string + paymentterms: + description: Payment Terms + type: string + phone: + description: Phone + type: string + purchaseamount: + description: Purchase Amount + format: double + type: number + quoteamount: + description: Quote Amount + format: double + type: number + quotenumber: + description: Quote Number + type: string + quotetoaddress: + description: Quote To + type: object + quotetoname: + description: Quote To Name + type: string + ref: + description: "Source System identifier for this record, if any" + type: string + salesregulation: + description: Sales Regulation Type + type: string + serviceterm: + description: Service Term + type: string + shippingaddress: + description: Ship To + type: object + shippingcontactid: + description: Shipping Contact + type: string + shippinghandling: + description: Shipping and Handling + format: double + type: number + shippingname: + description: Ship To Name + type: string + status: + description: Status + type: string + subtotal: + description: Subtotal + format: double + type: number + suppressworkflow: + description: Suppress Workflow? + type: boolean + tax: + description: Tax + format: double + type: number + taxitems: + description: The taxes associated with this Quote + items: + $ref: "#/definitions/TaxTransaction" + type: array + telecomtax: + description: Telecom Tax + format: double + type: number + templateid: + description: Template + type: string + totalprice: + description: Total Price + format: double + type: number + type: + description: Quote Type + type: string + type: object + QuoteBasic: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + description: Account + type: string + amount: + description: Quote Amount + type: number + amountdue: + description: Amount Due + type: number + coordinate: + $ref: "#/definitions/Address" + id: + description: Telnexus Record Id Only; not used in POST + type: string + items: + items: + $ref: "#/definitions/QuoteItemBasic" + type: array + parentfk: + description: + UUID Reference the master record that owns this item + type: string + quotedate: + description: Quote Date + type: string + ref: + description: "Source System identifier for this record, if any" + type: string + salesregulation: + description: Sales Regulation Type (Medicinal or Recreational) + type: string + status: + description: Status + type: string + subtotal: + description: Subtotal + format: double + type: number + type: + description: Type + type: string + type: object + QuoteItem: + properties: + tenantid: + description: tenant identifier + type: string + description: + description: Line Item Description + type: string + discount: + description: Discount + format: double + type: number + discountamount: + description: Discount Amount + format: double + type: number + id: + description: Telnexus Record Id Only; not used in POST + type: string + linegrossamount: + description: Line Gross Amount + format: double + type: number + linenumber: + description: Line Item Number + type: string + listprice: + description: List Price + type: number + locationid: + description: Location + type: string + parentfk: + description: + UUID Reference the master record that owns this item + type: string + productid: + description: Product record ID + type: string + productname: + description: Product Name + type: string + quantity: + description: Quantity + format: double + type: number + quoteid: + description: Quote Name + type: string + ref: + description: "Source System identifier for this record, if any" + type: string + servicedate: + description: Date + type: string + shippinghandling: + description: Shipping & Handling + format: double + type: number + subtotal: + description: Subtotal + format: double + type: number + supplierid: + description: Supplier + type: string + taxable: + description: Taxable? + format: double + type: string + totalprice: + description: Total Price + format: double + type: number + unitprice: + description: Sales Price + format: double + type: number + type: object + QuoteItemBasic: + properties: + tenantid: + description: tenant identifier + type: string + description: + description: Line Item Description + type: string + id: + description: Telnexus Record Id Only; not used in POST + type: string + invoiceid: + description: Invoice + type: string + parentfk: + description: + UUID Reference the master record that owns this item + type: string + productcode: + description: Product Code + type: string + quantity: + description: Quantity + format: double + type: number + ref: + description: "Source System identifier for this record, if any" + type: string + shippinghandling: + description: Shipping & Handling + format: double + type: number + subtotal: + description: Subtotal + format: double + type: number + taxnexuscode: + description: Telnexus Code + type: string + unitprice: + description: Unit Price + format: double + type: number + type: object + QuoteResponse: + properties: + data: + items: + $ref: "#/definitions/Quote" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + RequestMeta: + properties: + TelnexusAccount: + description: Telnexus Account Number of the Reseller or OEM + type: string + required: + - TelnexusAccount + type: object + ResponseMeta: + properties: + Contact: + description: Contact Info + type: string + Copyright: + description: Copyright Info + type: string + Info: + description: API Information + type: string + License: + description: License Info + type: string + OperationID: + type: string + Pagination: + $ref: "#/definitions/Pagination" + RequestIP: + type: string + RequestType: + type: string + RequestURL: + type: string + ServerInfo: + type: string + ServerResponseTime: + type: string + ServerTimeStamp: + type: string + TelnexusAccount: + type: string + UserID: + type: string + type: object + Service: + type: object + properties: + id: + type: string + description: Telnexus Record Id + active: + type: boolean + description: Active? + clusterid: + type: string + description: Cluster + clusterip: + type: string + description: Cluster IP + clusterurl: + type: string + description: Cluster URL + createdbyid: + type: string + description: Created By + createddate: + type: string + description: Created Date + environment: + type: string + description: Environment + externalurl: + type: string + description: External URL + gelfaddress: + type: string + description: GELF Address + lastmodifiedbyid: + type: string + description: Last Modified By + lastmodifieddate: + type: string + description: Last Modified Date + networkalias: + type: string + description: Network Alias + openapiversion: + type: string + description: OpenAPI Version + ownerid: + type: string + description: Owner + portexternal: + type: string + description: Port - External + porttest: + type: string + description: Port - Test + proxytype: + type: string + description: Proxy Type + replicas: + type: number + format: int64 + description: Replicas + repourl: + type: string + description: Repo URL + servicename: + type: string + description: Service Name + tenantid: + type: string + description: tenantid + version: + type: string + description: Version + ServiceRequest: + properties: + data: + items: + $ref: "#/definitions/Service" + type: array + meta: + $ref: "#/definitions/RequestMeta" + required: + - meta + - data + type: object + ServiceResponse: + description: An array of Service Objects + properties: + data: + items: + $ref: "#/definitions/Service" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + State: + properties: + accountid: + description: Account + type: string + amount: + description: Rollup Amount + format: double + type: number + code: + description: State Code + type: string + contactid: + description: Contact + type: string + latitude: + type: number + format: double + longitude: + type: number + format: double + contryid: + description: Country + type: string + division: + description: Division + type: string + enrollmentstatus: + description: Enrollment Status + type: string + fips: + description: FIPS + type: string + geocode: + description: State Geocode + type: string + gnis: + description: GNIS + type: number + format: int64 + id: + description: Telnexus Record Id + type: string + interest: + description: Interest + type: number + landarea: + description: Land Area + type: number + format: int64 + name: + description: State Name + type: string + penalty: + description: Penalty + type: number + format: double + ref: + description: "Source System identifier for this record, if any" + type: string + region: + description: Region + type: string + reportedadjustments: + description: Reported Adjustments + type: number + format: double + reporteddeductions: + description: Reported Deductions + type: number + format: double + reportednetrevenue: + description: Reported Net Revenue + type: number + format: double + reportedrate: + description: Reported Rate + type: number + format: double + reportedrevenue: + description: Reported Revenue + type: number + format: double + revenuebase: + description: Rollup Revenue Base + type: number + format: double + revenuenet: + description: Rollup Revenue Net + type: number + format: double + revenuenottaxable: + description: Rollup Revenue Not Taxable + type: number + format: double + sgc: + description: SGC + type: string + status: + description: Document Status + type: string + subtotal: + description: Reported Tax + type: number + format: double + taxinstances: + items: + $ref: "#/definitions/TaxInstance" + type: array + templateid: + description: Template + type: string + totalamount: + description: Total Amount + type: number + format: double + totalarea: + description: Total Area + type: number + format: int64 + unitbase: + description: Unit Base + type: number + format: double + waterarea: + description: Water Area + format: int64 + type: number + type: object + StateResponse: + description: An array of State objects + properties: + data: + items: + $ref: "#/definitions/State" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Statement: + properties: + tenantid: + description: tenant identifier + type: string + account: + description: Account + type: string + accountbalance: + description: Account Balance + type: number + accountcity: + description: Account City + type: string + accountcountry: + description: Account Country + type: string + accountname: + description: Account Name + type: string + accountpostalcode: + description: Account Postal Code + type: string + accountstate: + description: Account State + type: string + accountstatecode: + description: Account State Code + type: string + accountstreet: + description: Account Street + type: string + billingcountrycode: + description: Billing Country Code + type: string + contact: + description: Contact + type: string + date: + description: Statement Date + type: string + datefrom: + description: Date From + type: string + dateto: + description: Date To + type: string + deliverymethod: + description: Delivery Method + type: string + name: + description: Statement Number + type: string + recipientemail: + description: Recipient Email + type: string + recipienttype: + description: Recipient Type + type: string + statementid: + description: Statement Salesforce ID + type: string + type: object + StatementRequest: + properties: + data: + items: + $ref: "#/definitions/Statement" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + StatementResponse: + description: An array of Statement objects + properties: + data: + items: + $ref: "#/definitions/Statement" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Submission: + properties: + tenantid: + description: tenant identifier + type: string + companyid: + description: The Company that did the submission (Telnexus) + type: string + contactid: + description: Submission Contact + type: string + createdbyid: + description: Created By User ID + type: string + createddate: + description: Created Date + type: string + id: + description: Telnexus Record Id Only; not used in POST + type: string + lastmodifiedbyid: + description: Last Modified By User ID + type: string + lastmodifieddate: + description: Last Modified Date + type: string + notes: + description: Cover Letter + type: string + parentfk: + description: + UUID Reference the master record that owns this item + type: string + penalty: + description: Penalty paid + format: double + type: number + ref: + description: "Source System identifier for this record, if any" + type: string + reportedadjustments: + description: Reported Adjustments + format: double + type: number + reporteddeductions: + description: Reported Deductions + format: double + type: number + reportednetrevenue: + description: Reported Net Revenue + format: double + type: number + reportedrate: + description: Reported Rate + format: double + type: number + reportedrevenue: + description: Reported Revenue + format: double + type: number + revenuebase: + description: Revenue Base + format: double + type: number + revenuenet: + description: Revenue Net + format: double + type: number + revenuenottaxable: + description: Revenue Not Taxable + format: double + type: number + status: + description: Status + type: string + date: + description: Submission Date + type: string + submissionnumber: + description: Submission Number + type: string + subtotal: + description: Amount of remittance before penalty + format: double + type: number + taxtypeid: + description: + Telnexus ID of the TaxType for which this submssion is being + made + type: string + totalamount: + description: Total Amount of remittance + format: double + type: number + type: object + SubmissionRequest: + properties: + data: + items: + $ref: "#/definitions/Submission" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + SubmissionResponse: + description: An array of Submission objects + properties: + data: + items: + $ref: "#/definitions/Submission" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Subscription: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + type: string + activateddate: + description: Activated Date + type: string + activateduserid: + description: Activated By + type: string + allowedminutesinbound: + description: Allowed Minutes Inbound + format: double + type: number + allowedminutesoutbound: + description: Allowed Minutes Outbound + format: double + type: number + amount: + description: Amount + format: double + type: number + assetid: + description: Asset Name + type: string + auditmessage: + description: Audit Trail Message + type: string + canceldate: + description: Cancel Date + type: string + contract: + $ref: "#/definitions/ContractBasic" + description: + description: Description + type: string + directionsensitive: + description: Direction Sensitive Rating? + type: boolean + effectivedate: + description: Effective Date + type: string + email: + description: Email + type: string + enduserid: + type: string + fax_emails: + description: Fax Emails + type: string + id: + description: Telnexus Record Id + type: string + isactive: + description: Active? + type: boolean + orderdate: + description: Order Date + type: string + orderitemid: + description: Order Item + type: string + overagerateinbound: + description: Overage Rate Inbound + format: double + type: number + overagerateoutbound: + description: Overage Rate Outbound + format: double + type: number + password: + description: Password + type: string + paymentterms: + description: Payment Terms + type: string + pricebookid: + description: Price Book + type: string + productid: + description: Product record ID + type: string + productcode: + description: Product Code + type: string + productname: + description: Product Name + type: string + quantity: + description: Quantity + type: string + quoteitemid: + description: Quote Item + type: string + seq: + description: Subscription ID + type: string + status: + description: Status + type: string + suretax: + description: Suretax Code + type: string + tollfreerating: + description: tollfreeRating + type: boolean + type: + description: Type + type: string + unitprice: + description: Unit Price + format: double + type: number + units: + description: Units + type: string + unlimited: + description: Unlimited usage? + type: boolean + username: + description: Username + type: string + type: object + SubscriptionRequest: + properties: + data: + items: + $ref: "#/definitions/Subscription" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + SubscriptionResponse: + properties: + data: + items: + $ref: "#/definitions/Subscription" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + TaxInstance: + properties: + countryid: + description: + The Telnexus ID of the Country that owns this instance + type: string + countyid: + description: + The Telnexus ID of the County that owns this instance + type: string + createdbyid: + type: string + createddate: + description: The creation date of this database record + type: string + lastmodifiedbyid: + type: string + lastmodifieddate: + type: string + placeid: + description: + The Telnexus ID of the Place that owns this instance + type: string + stateid: + description: + The Telnexus ID of the State that owns this instance + type: string + taxtypeid: + description: The Telnexus Tax Type ID of this instance + type: string + type: + description: + "The Type of instance refers to the linking object (place, + county, state, country)" + type: string + type: object + TaxInvoicesRequest: + properties: + data: + items: + $ref: "#/definitions/InvoiceBasic" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + TaxOrdersRequest: + properties: + data: + items: + $ref: "#/definitions/OrderBasic" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + TaxPurchaseOrdersRequest: + properties: + data: + items: + $ref: "#/definitions/PurchaseOrderBasic" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + TaxQuotesRequest: + properties: + data: + items: + $ref: "#/definitions/QuoteBasic" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + TaxTransaction: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + description: Account + type: string + amount: + description: Amount + format: double + type: number + effectiverate: + description: Effective Rate + format: double + type: number + filingid: + description: Filing + type: string + id: + description: Telnexus Record Id + type: string + invoiceid: + description: Invoice + type: string + invoiceitemid: + description: Invoice Item + type: string + issummary: + description: isSummary + type: boolean + journalitemid: + description: + "The Id of the GL Journal Item, part of a Journal Entry" + type: string + orderid: + description: Order + type: string + orderitemid: + description: Order Product + type: string + percenttaxable: + description: Percent Taxable + format: double + type: number + periodid: + description: Period + type: string + placeid: + description: Place + type: string + posted: + description: Posted + type: boolean + quoteid: + description: Quote + type: string + quoteitemid: + description: Quote Line Item + type: string + ratingingestid: + description: Rating Ingest + type: string + ratingtype: + description: Rating Type + type: string + revenuebase: + description: Revenue Base + format: double + type: number + revenuenet: + description: Revenue Net + format: double + type: number + revenuenottaxable: + description: Revenue Not Taxable + format: double + type: number + taxexemptrevenue: + description: Tax Exempt Revenue + format: double + type: number + taxrate: + description: Tax Rate + format: double + type: number + taxtypeid: + description: Tax Type + type: string + unitbase: + description: Unit Base + format: double + type: number + unitfeerate: + description: Unit Fee Rate + format: double + type: number + type: object + TaxTransactionResponse: + properties: + data: + items: + $ref: "#/definitions/TaxTransaction" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + TaxType: + properties: + accountid: + description: Authority Account Id + type: string + accountingrulecode: + description: The Accounting Rule Code used for GL Post + type: string + active: + description: Active + type: boolean + agencytype: + description: Agency Type + type: string + agentid: + description: Collection Agent Id + type: string + category: + description: Category + type: string + collectordomainid: + description: Collector Domain Id + type: string + companyid: + description: Company ID + type: string + contactid: + description: Authority Contact Id + type: string + createdbyid: + description: Created By User ID + type: string + createddate: + description: Created Date + type: string + description: + description: Description + type: string + effectivedate: + description: Effective Date + type: string + enddate: + description: End Date + type: string + enrollmentstatus: + description: Enrollment Status + type: string + filingcity: + description: Filing City + type: string + filingcountry: + description: Filing Country + type: string + filingemail: + description: Filing Email + type: string + filingmethod: + description: Filing Method + type: string + filingpostalcode: + description: Filing Postal Code + type: string + filingstate: + description: Filing State + type: string + filingstreet: + description: Filing Street + type: string + fractional: + description: + Does this Tax Type use a Fractional Basis for calculation? + type: boolean + frequency: + description: Frequency + type: string + geocodestring: + description: Geocode String + type: string + id: + description: Telnexus Record Id + type: string + interestrate: + description: Interest Rate + format: double + type: number + ismedicinal: + description: Business Tax? + type: boolean + isrecreational: + description: Cannabis Tax? + type: boolean + itemamount: + description: Rollup Amount + format: double + type: number + itemcount: + description: Rollup Tax Items + format: double + type: number + lastmodifiedbyid: + description: Last Modified By User ID + type: string + lastmodifieddate: + description: Last Modified Date + type: string + markuprate: + description: + The wholesale markup rate for Excise tax (CA cannabis) + format: double + type: number + name: + description: Tax Type Name (unique) + type: string + passthrough: + description: + Is this tax allowed to be passed-through to retail customers? + type: boolean + penaltydays: + description: Number of days until penalty is assessed + format: int64 + type: number + penaltyrate: + description: The percentage rate of a penalty (per month) + format: double + type: number + rate: + description: Tax Rate + format: double + type: number + reference: + description: Tax Website Reference + type: string + salesregulation: + description: Salesregulation Code for this TaxType + type: string + status: + description: TaxType Document Status + type: string + taxnexuscodeid: + description: Telnexus Code Id + type: string + taxnexusnumber: + description: The Tax Type number assigned by Telnexus + type: string + templateid: + description: Rendering Template Id + type: string + unitbase: + description: Rollup Unit Base + format: double + type: number + units: + description: Units + type: string + type: object + TaxTypeAccount: + properties: + tenantid: + type: string + accountid: + description: Account + type: string + accountnumber: + description: Account Number + type: string + active: + description: Active + type: boolean + amount: + description: Rollup Amount + format: double + type: number + contactid: + description: Contact ID + type: string + createdbyid: + type: string + createddate: + type: string + description: + description: Description + type: string + enddate: + description: End Date + type: string + id: + description: Telnexus Record Id Only; not used in POST + type: string + interest: + description: Interest + type: number + lastmodifiedbyid: + type: string + lastmodifieddate: + type: string + notes: + description: Notes + type: string + parentfk: + description: + UUID Reference the master record that owns this item + type: string + penalty: + description: Penalty + format: double + type: number + ref: + description: "Source System identifier for this record, if any" + type: string + reportedadjustments: + description: Reported Adjustments + format: double + type: number + reporteddeductions: + description: Reported Deductions + format: double + type: number + reportednetrevenue: + description: Reported Net Revenue + format: double + type: number + reportedrate: + description: Reported Rate + format: double + type: number + reportedrevenue: + description: Reported Revenue + format: double + type: number + revenuebase: + description: Rollup Revenue Base + format: double + type: number + revenuenet: + description: Rollup Revenue Net + format: double + type: number + revenuenottaxable: + description: Rollup Revenue Not Taxable + format: double + type: number + startdate: + description: Start Date + type: string + subtotal: + description: Reported Tax + format: double + type: number + tax: + description: Rollup Tax + format: double + type: number + taxontax: + description: Rollup Tax on Tax + format: double + type: number + taxtypeid: + description: Tax Type + type: string + totalamount: + description: Total Amount + format: double + type: number + unitbase: + description: Rollup Unit Base + format: double + type: number + type: object + TaxTypeAccountRequest: + properties: + data: + items: + $ref: "#/definitions/TaxTypeAccount" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + TaxTypeAccountResponse: + description: An array of TaxType Account objects with Contacts + properties: + data: + items: + $ref: "#/definitions/TaxTypeAccount" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + TaxTypeResponse: + description: An array of Tax Type objects + properties: + data: + items: + $ref: "#/definitions/TaxType" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + TelnexusCode: + properties: + active: + description: Is this an active Telnexus Code? + type: boolean + code: + description: Telnexus Code + type: string + createdbyid: + description: Created By User ID + type: string + createddate: + description: Created Date + type: string + description: + description: Telnexus Code Description + type: string + domainid: + description: Domain ID + type: string + domainname: + description: Domain Name + type: string + id: + description: Telnexus Record Id Only; not used in POST + type: string + level: + description: Level + type: string + lastmodifiedbyid: + description: Last Modified By User ID + type: string + lastmodifieddate: + description: Last Modified Date + type: string + part1: + description: Telnexus Code Part 1 + type: string + part2: + description: Telnexus Code Part 2 + type: string + part3: + description: Telnexus Code Part 3 + type: string + part4: + description: Telnexus Code Part 4 + type: string + part5: + description: Telnexus Code Part 4 + type: string + purchasingrulesetcode: + description: Purchasing Ruleset AccountingRuleset Code + type: string + purchasingrulesetid: + description: Purchasing Ruleset AccountingRuleset ID + type: string + ref: + description: External reference, if any + type: string + revenuerulesetcode: + description: Revenue Ruleset AccountingRuleset Code + type: string + revenuerulesetid: + description: Revenue Ruleset AccountingRuleset ID + type: string + type: object + TelnexusCodeResponse: + properties: + data: + items: + $ref: "#/definitions/TelnexusCode" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Template: + properties: + tenantid: + description: tenant identifier + type: string + CompanyID: + description: Company + type: string + CreatedByID: + type: string + CreatedDate: + type: string + Description: + description: Description + type: string + HTML: + description: HTML Body + type: string + format: byte + ID: + description: Telnexus Record Id + type: string + IsActive: + description: Active? + type: boolean + IsMaster: + description: Master Template? + type: boolean + LastModifiedByID: + type: string + LastModifiedDate: + type: string + Name: + description: Template Name + type: string + ObjectType: + description: Object + type: string + RecordTypeName: + description: Record Type Name + type: string + Type: + description: Type + type: string + URL: + description: URL + type: string + type: object + TemplateResponse: + properties: + data: + items: + $ref: "#/definitions/Template" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + User: + properties: + tenantid: + type: string + aboutme: + description: About Me + type: string + accountid: + description: Account ID + type: string + address: + $ref: "#/definitions/Address" + alias: + description: Alias + type: string + apikey: + description: API Key + type: string + auth0userid: + description: Auth0 User ID + type: string + communitynickname: + description: Nickname + type: string + companyname: + description: Company Name + type: string + contactid: + description: Contact + type: string + createdbyid: + description: Created User ID + type: string + createddate: + description: Date Created + type: string + delegatedapproverid: + description: Delegated Approver + type: string + department: + description: Department + type: string + division: + description: Division + type: string + email: + description: Email address + type: string + employeenumber: + description: Employee Number + type: string + endday: + description: Time day ends + type: string + environment: + description: Environment + type: string + extension: + description: Extension + type: string + fabricapikey: + description: Fabric API Key + type: string + fax: + description: Fax + type: string + firstname: + description: The first name + type: string + forecastenabled: + description: Allow Forecasting + type: boolean + fullphotourl: + description: Full Photo URL + type: string + id: + description: Telnexus ID + type: string + isactive: + description: Active + type: boolean + isportalenabled: + description: Is the user enabled for Communities? + type: boolean + isprofilephotoactive: + description: Has Profile Photo + type: boolean + issystemcontrolled: + type: boolean + lastip: + description: ip address of last login + type: string + lastlogin: + description: last login time + type: string + lastmodifiedbyid: + description: Last Modified User ID + type: string + lastmodifieddate: + description: Last Modified Date + type: string + lastname: + description: The Last Name + type: string + logincount: + description: number of times user has logged in + format: int64 + type: number + managerid: + description: Manager + type: string + mobilephone: + description: Mobile + type: string + name: + description: Name + type: string + outofofficemessage: + description: Out of office message + type: string + phone: + description: Phone + type: string + portalrole: + description: Portal Role Level + type: string + profileid: + description: Profile + type: string + receivesadmininfoemails: + description: Admin Info Emails + type: boolean + receivesinfoemails: + description: Info Emails + type: boolean + senderemail: + description: Email Sender Address + type: string + sendername: + description: Email Sender Name + type: string + signature: + description: Email Signature + type: string + smallphotourl: + description: Small Photo URL + type: string + startday: + description: The time day starts + type: string + TelnexusAccount: + description: Telnexus Account + type: string + timezonesidkey: + description: Time Zone + type: string + title: + description: Title + type: string + username: + description: Username + type: string + userroleid: + description: Role + type: string + usertype: + description: User Type + type: string + userroles: + items: + $ref: "#/definitions/UserRole" + type: array + tenantusers: + items: + $ref: "#/definitions/TenantUser" + type: array + type: object + UserResponse: + description: An array of Print-Ready ingest Objects + properties: + data: + items: + $ref: "#/definitions/User" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Notebook: + description: Defines a Telnexus Notebook + type: object + properties: + tenantid: + description: tenant identifier + type: string + id: + type: string + description: Record Id + accountid: + type: string + description: Account + contactid: + type: string + description: Contact + createdbyid: + type: string + description: Created By + createddate: + type: string + description: Created Date + date: + type: string + description: Analysis Date + dateend: + type: string + description: End Date + datestart: + type: string + description: Start Date + description: + type: string + description: Description + lastmodifiedbyid: + type: string + description: Last Modified By + lastmodifieddate: + type: string + description: Last Modifed Date + periodendid: + type: string + description: Ending Period + periodstartid: + type: string + description: Starting Period + preparerid: + type: string + description: Preparer + title: + type: string + description: Title + items: + type: array + items: + $ref: "#/definitions/NotebookItem" + NotebookRequest: + description: An array of Notebook objects + properties: + data: + items: + $ref: "#/definitions/Notebook" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + NotebookResponse: + description: An array of Notebook objects + properties: + data: + items: + $ref: "#/definitions/Notebook" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + NotebookItem: + type: object + description: An analysis item associated with a Notebook + properties: + tenantid: + description: tenant identifier + type: string + id: + type: string + description: Record Id + itemname: + type: string + description: Developer name of component + title: + type: string + description: Display title + notebookid: + type: string + description: The notebook that owns this Item + Tenant: + type: object + description: Telnexus Account Tenant + properties: + id: + type: string + description: Record Id + accountid: + type: string + description: The Account that owns this Tenant + active: + type: boolean + description: Is this Tenant currently active? + createdbyid: + type: string + description: Created By + createddate: + type: string + description: Created Date + lastmodifiedbyid: + type: string + description: Last Modified By + lastmodifieddate: + type: string + description: Last Modifed Date + status: + type: string + description: The current status of this Tenant + tenantname: + type: string + description: Name of the Tenant Resource + type: + type: string + description: Type of tenant + version: + type: string + description: + The version number of the Tenant Onboarding system used to + create this tenant + databases: + items: + $ref: "#/definitions/Database" + type: array + roles: + items: + $ref: "#/definitions/Role" + type: array + tenantusers: + items: + $ref: "#/definitions/TenantUser" + type: array + Role: + type: object + description: A functional role within a Tenant + properties: + id: + type: string + description: record id + auth0roleid: + description: the corresponding auth0 role + type: string + createdbyid: + type: string + description: created by + createddate: + type: string + description: created date + description: + type: string + description: role description + lastmodifiedbyid: + type: string + description: last modified by + lastmodifieddate: + type: string + description: last modifed date + rolename: + type: string + description: the name of this role + tenantid: + type: string + description: the id of the tenant that owns this role + RoleRequest: + description: An array of Role objects + properties: + data: + items: + $ref: "#/definitions/Role" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + RoleResponse: + description: An array of Role objects + properties: + data: + items: + $ref: "#/definitions/Role" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + TenantRequest: + description: An array of Tenant objects + properties: + data: + items: + $ref: "#/definitions/Tenant" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + TenantResponse: + description: An array of Tenant objects + properties: + data: + items: + $ref: "#/definitions/Tenant" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Database: + type: object + description: A Database provisioned and owned by a Tenant + properties: + active: + description: Is this database active? + type: boolean + clusterid: + description: + The ID of the Cluster in which this database is deployed + type: string + createdbyid: + description: Created By + type: string + createddate: + description: Created Date + type: string + databasename: + description: The name of the physical database in the cluster + type: string + dsn: + description: Database connection string + type: string + id: + description: Record Id + type: string + lastmodifiedbyid: + description: Last Modified By + type: string + lastmodifieddate: + description: Last Modifed Date + type: string + microservices: + description: + List of Telnexus microservices implemented by this Database + type: string + status: + description: The current status of this Tenant + type: string + tenantid: + description: The ID of the tenant who owns this Database + type: string + type: + description: "The type of Database (mysql, etc)" + type: string + DatabaseRequest: + description: An array of Database objects + properties: + data: + items: + $ref: "#/definitions/Database" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + DatabaseResponse: + description: An array of Database objects + properties: + data: + items: + $ref: "#/definitions/Database" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + TenantUser: + description: Relationship object that connects users to a tenant + type: object + properties: + accesslevel: + type: string + description: The Tenant access level for this User + tenantid: + type: string + description: The Tenant ID + userid: + type: string + description: The User ID + UserRole: + description: Relationship object that connects user to a role + type: object + properties: + description: + type: string + description: Role description + roleid: + type: string + description: The Role ID + userid: + type: string + description: The User ID + name: + type: string + description: Role Name + auth0roleid: + type: string + description: Linked role ID diff --git a/swagger/stash-telnexus.yaml b/swagger/stash-telnexus.yaml new file mode 100644 index 0000000..2421401 --- /dev/null +++ b/swagger/stash-telnexus.yaml @@ -0,0 +1,216 @@ +swagger: "2.0" +info: + version: 0.0.2 + title: "stash" + description: "PDF Storage Microservice" + termsOfService: "http://telnexus.com/terms/" + contact: + email: "noc@telnexus.com" + license: + name: "Proprietary - Copyright (c) 2018-2020 by Telnexus LLC" +securityDefinitions: + ApiKeyAuth: + type: "apiKey" + in: "header" + name: "X-API-Key" +security: + - ApiKeyAuth: [] +schemes: + - "http" +basePath: "/v1" +host: "stash.infra.tnxs.net:8080" +consumes: + - "application/json" +produces: + - "application/json" +parameters: + X-API-Key: + name: X-API-Key + in: "header" + required: true + type: string + PDFRequest: + description: An array of new PDF records + in: body + name: PDFRequest + required: true + schema: + $ref: "#/definitions/PDFRequest" + pdfIdQueryRequired: + description: PDF record ID + in: query + name: pdfId + required: true + type: string +responses: + AccessForbidden: + description: "Access forbidden, account lacks access" + schema: + $ref: "#/definitions/Error" + NotFound: + description: Resource was not found + schema: + $ref: "#/definitions/Error" + PdfResponse: + description: Telnexus Response with an array of pdfs + schema: + $ref: "#/definitions/DocumentResponse" + ServerError: + description: Server Internal Error + schema: + $ref: "#/definitions/Error" + Unauthorized: + description: "Access Unauthorized, invalid API-KEY was used" + schema: + $ref: "#/definitions/Error" + UnprocessableEntity: + description: "Unprocessable Entity, likely a bad parameter" + schema: + $ref: "#/definitions/Error" + DocumentResponse: + description: Rendered documents response + schema: + $ref: "#/definitions/DocumentResponse" +paths: + /pdfs: + post: + description: Store new PDFs + operationId: postPdfs + parameters: + - $ref: "#/parameters/PDFRequest" + responses: + "200": + $ref: "#/responses/DocumentResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Create new PDFs + tags: + - StashPdf +definitions: + Document: + properties: + Filename: + type: string + ID: + type: string + SagaType: + type: string + ParentID: + type: string + Title: + type: string + URI: + type: string + type: object + DocumentResponse: + description: An array of rendered documents + properties: + Data: + items: + $ref: "#/definitions/Document" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + Error: + properties: + Code: + format: int64 + type: number + Fields: + type: string + Message: + type: string + type: object + NewPDF: + properties: + Description: + description: Description + type: string + Filename: + description: Filename only + type: string + HTML: + description: The HTML data in text format + type: string + LastAccessedByID: + description: Last Accessed By + type: string + ObjectType: + description: This document's financial object origination + type: string + OwnerID: + description: User who created the PDF + type: string + ParentID: + description: ID of the record that owns this PDF + type: string + Ref: + description: External reference if any + type: string + Title: + description: Document descriptive title + type: string + type: object + PDFRequest: + properties: + Data: + items: + $ref: "#/definitions/NewPDF" + type: array + Meta: + $ref: "#/definitions/RequestMeta" + type: object + RequestMeta: + properties: + TelnexusAccount: + description: Telnexus Account Number of the Reseller or OEM + type: string + required: + - TelnexusAccount + type: object + ResponseMeta: + properties: + Contact: + description: Microservice Contact Info + type: string + Copyright: + description: Copyright Info + type: string + License: + description: License Information and Restrictions + type: string + OperationID: + description: Operation ID + type: string + RequestIP: + description: Request IP Address + type: string + RequestType: + description: Request Type + type: string + RequestURL: + description: Request URL + type: string + ServerInfo: + description: Data Server Info + type: string + ServerResponseTime: + description: Data Server Response Time (ms) + type: string + ServerTimestamp: + description: Backend Server Timestamp + type: string + TelnexusAccount: + description: + Telnexus Account Number used for recording transactions + type: string + type: object diff --git a/swagger/voip-telnexus.yaml b/swagger/voip-telnexus.yaml new file mode 100644 index 0000000..69db38a --- /dev/null +++ b/swagger/voip-telnexus.yaml @@ -0,0 +1,1507 @@ +swagger: "2.0" +info: + version: 0.0.2 + title: voip + description: Telnexus VoIP Microservice + termsOfService: http://telnexus.com/terms/ + contact: + email: noc@telnexus.com + license: + name: Proprietary - Copyright (c) 2012-2020 by Telnexus LLC +securityDefinitions: + ApiKeyAuth: + type: apiKey + in: header + name: X-API-Key +security: + - ApiKeyAuth: [] +schemes: + - http +basePath: /v1 +host: voip.infra.tnxs.net:8080 +consumes: + - application/json +produces: + - application/json +responses: + AuthorityResponse: + description: Telnexus Response with an array of Authority objects + schema: + $ref: "#/definitions/AuthorityResponse" + EndpointResponse: + description: Telnexus Response with an array of PBX objects + schema: + $ref: "#/definitions/EndpointResponse" + PhoneNumberResponse: + description: Telnexus Response with an array of PBX objects + schema: + $ref: "#/definitions/PhoneNumberResponse" + VmBoxResponse: + description: Telnexus Response with an array of PBX objects + schema: + $ref: "#/definitions/VmBoxResponse" + PbxResponse: + description: Telnexus Response with an array of PBX objects + schema: + $ref: "#/definitions/PbxResponse" + QueueResponse: + description: Telnexus Response with an array of Queue objects + schema: + $ref: "#/definitions/QueueResponse" + PbxUserResponse: + description: Telnexus Response with an array of PBX User objects + schema: + $ref: "#/definitions/PbxUserResponse" + AccessForbidden: + description: "Access forbidden, account lacks access" + schema: + $ref: "#/definitions/Error" + NotFound: + description: Resource was not found + schema: + $ref: "#/definitions/Error" + ServerError: + description: Server Internal Error + schema: + $ref: "#/definitions/Error" + Unauthorized: + description: "Access Unauthorized, invalid API-KEY was used" + schema: + $ref: "#/definitions/Error" + UnprocessableEntity: + description: "Unprocessable Entity, likely a bad parameter" + schema: + $ref: "#/definitions/Error" +parameters: + AuthorityRequest: + description: A request with an array of Authority Objects + in: body + name: authorityRequest + required: true + schema: + $ref: "#/definitions/AuthorityRequest" + EndpointRequest: + description: An array of new PBX records + in: body + name: endpointRequest + required: true + schema: + $ref: "#/definitions/EndpointRequest" + PbxRequest: + description: An array of new PBX records + in: body + name: pbxRequest + required: true + schema: + $ref: "#/definitions/PbxRequest" + PbxUserRequest: + description: An array of new PBX User records + in: body + name: pbxUserRequest + required: true + schema: + $ref: "#/definitions/PbxUserRequest" + PhoneNumberRequest: + description: An array of new PBX records + in: body + name: phoneNumberRequest + required: true + schema: + $ref: "#/definitions/PhoneNumberRequest" + VmBoxRequest: + description: An array of new VmBoxes + in: body + name: vmBoxRequest + required: true + schema: + $ref: "#/definitions/VmBoxRequest" + queueRequest: + description: An array of new Queues + in: body + name: queueRequest + required: true + schema: + $ref: "#/definitions/QueueRequest" + authorityIdQuery: + description: Telnexus Id of the Authority to be retrieved + in: query + name: authorityId + required: false + type: string + queueIdQuery: + description: Telnexus Id of the Queue to be retrieved + in: query + name: queueId + required: false + type: string + endpointIdQuery: + description: Telnexus Id of the endpoint to be retrieved + in: query + name: endpointId + required: false + type: string + limitQuery: + default: 100 + description: + "How many objects to return at one time (max 300, default 100)" + format: int64 + in: query + name: limit + required: false + type: integer + offsetQuery: + default: 0 + description: How many objects to skip? (default 0) + format: int64 + in: query + name: offset + required: false + type: integer + pbxIdQuery: + description: Telnexus Id of the PBX to be retrieved + in: query + name: pbxId + required: false + type: string + pbxUserIdQuery: + description: Telnexus Id of the PBX User to be retrieved + in: query + name: pbxUserId + required: false + type: string + phoneNumberIdQuery: + description: Telnexus Id of the Phone Number to be retrieved + in: query + name: phoneNumberId + required: false + type: string + vmBoxIdQuery: + description: Telnexus Id of the vmBox to be retrieved + in: query + name: vmBoxId + required: false + type: string +paths: + /authorities: + get: + description: Return a list of available Authorities + operationId: getAuthorities + parameters: + - $ref: "#/parameters/authorityIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/AuthorityResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Authorities + tags: + - Authority + post: + consumes: + - application/json + description: Create new Authorities + operationId: postAuthorities + parameters: + - $ref: "#/parameters/AuthorityRequest" + responses: + "200": + $ref: "#/responses/AuthorityResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Add new Authorities + tags: + - Authority + put: + consumes: + - application/json + description: + Update fields in an Authority record identified by Telnexus Id + operationId: putAuthorities + parameters: + - $ref: "#/parameters/AuthorityRequest" + responses: + "200": + $ref: "#/responses/AuthorityResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Update Authorities + tags: + - Authority + /endpoints: + get: + description: Return a list of available Endpoint entities + operationId: getEndpoints + parameters: + - $ref: "#/parameters/endpointIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/EndpointResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Endpoints + tags: + - Endpoint + post: + consumes: + - application/json + description: Create new Endpoints + operationId: postEndpoints + parameters: + - $ref: "#/parameters/EndpointRequest" + responses: + "200": + $ref: "#/responses/EndpointResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Add new Endpoints + tags: + - Endpoint + put: + consumes: + - application/json + description: + Update fields in Endpoint records identified by Telnexus Id + operationId: putEndpoints + parameters: + - $ref: "#/parameters/EndpointRequest" + responses: + "200": + $ref: "#/responses/EndpointResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Update Endpoints + tags: + - Endpoint + /pbxes: + get: + description: Return a list of available PBX entities + operationId: getPBXes + parameters: + - $ref: "#/parameters/pbxIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/PbxResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of PBXes + tags: + - Pbx + post: + consumes: + - application/json + description: Create new PBXes + operationId: postPBXes + parameters: + - $ref: "#/parameters/PbxRequest" + responses: + "200": + $ref: "#/responses/PbxResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Add new PBXes + tags: + - Pbx + put: + consumes: + - application/json + description: + Update fields in an PBX record identified by Telnexus Id + operationId: putPBXes + parameters: + - $ref: "#/parameters/PbxRequest" + responses: + "200": + $ref: "#/responses/PbxResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Update PBXes + tags: + - Pbx + /pbxusers: + get: + description: Return a list of available PBX Users + operationId: getPBXUsers + parameters: + - $ref: "#/parameters/pbxUserIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/PbxUserResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Authorities + tags: + - PbxUser + post: + consumes: + - application/json + description: Create new PBXUsers + operationId: postPBXUsers + parameters: + - $ref: "#/parameters/PbxUserRequest" + responses: + "200": + $ref: "#/responses/PbxUserResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Add new PBXUsers + tags: + - PbxUser + put: + consumes: + - application/json + description: + Update fields in PBXUsers record identified by Telnexus Id + operationId: PBXUsers + parameters: + - $ref: "#/parameters/PbxUserRequest" + responses: + "200": + $ref: "#/responses/PbxUserResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Update PBXUsers + tags: + - PbxUser + /phonenumbers: + get: + description: Return a list of available Phone Number entities + operationId: getPhoneNumbers + parameters: + - $ref: "#/parameters/phoneNumberIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/PhoneNumberResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Phone Number + tags: + - PhoneNumber + post: + consumes: + - application/json + description: Create new Phone Numbers + operationId: postPhoneNumbers + parameters: + - $ref: "#/parameters/PhoneNumberRequest" + responses: + "200": + $ref: "#/responses/PhoneNumberResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Add new Phone Numbers + tags: + - PhoneNumber + put: + consumes: + - application/json + description: + Update fields in an Phone Number record identified by Telnexus + Id + operationId: putPhoneNumbers + parameters: + - $ref: "#/parameters/PhoneNumberRequest" + responses: + "200": + $ref: "#/responses/PhoneNumberResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Update Phone Numbers + tags: + - PhoneNumber + /vmboxes: + get: + description: Return a list of available Voice Mail Box entities + operationId: getVmBoxes + parameters: + - $ref: "#/parameters/vmBoxIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/VmBoxResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Voice Mail Boxes + tags: + - VmBox + post: + consumes: + - application/json + description: Create new VmBoxes + operationId: postVmBoxes + parameters: + - $ref: "#/parameters/VmBoxRequest" + responses: + "200": + $ref: "#/responses/VmBoxResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Add new Voice Mail Boxes + tags: + - VmBox + put: + consumes: + - application/json + description: + Update fields in Voice Mail Box records identified by Telnexus + Id + operationId: putVmBoxes + parameters: + - $ref: "#/parameters/VmBoxRequest" + responses: + "200": + $ref: "#/responses/VmBoxResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Update Voice Mail Boxes + tags: + - VmBox + /queues: + get: + description: Return a list of available Queues + operationId: getQueues + parameters: + - $ref: "#/parameters/queueIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/QueueResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Queues + tags: + - Queue + post: + consumes: + - application/json + description: Create new Queues + operationId: postQueues + parameters: + - $ref: "#/parameters/queueRequest" + responses: + "200": + $ref: "#/responses/QueueResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Add new Queues + tags: + - Queue + put: + consumes: + - application/json + description: + Update fields in Queue records identified by Telnexus Id + operationId: putQueues + parameters: + - $ref: "#/parameters/queueRequest" + responses: + "200": + $ref: "#/responses/QueueResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Update Queues + tags: + - Queue +definitions: + Endpoint: + properties: + AssetID: + description: Asset ID + type: string + CallForwardID: + description: Call Forwarding Record ID + type: string + CallRestrictionID: + description: Call Restriction Record ID + type: string + CallerIdOverride: + description: Endpoint CNAM Override + type: string + ContactID: + description: Telnexus Contact ID + type: string + DeviceType: + description: Device Type + type: string + DialPlan: + description: Dial Plan + type: string + DoNotDisturb: + description: Do Not Disturb + type: string + DoNotDisturbEnabled: + description: Do Not Disturb Enabled? + type: boolean + Enabled: + description: Endpoint Enabled? + type: boolean + EndpointName: + description: Endpoint Name + type: string + ExcludeFromQueues: + description: Exclude From Queues? + type: boolean + ID: + description: Telnexus Record ID + type: string + KazooEndpointID: + description: Kazoo Endpoint ID + type: string + Language: + description: Endpoint Language Override + type: string + MacAddress: + description: MAC Address + type: string + MusicOnHold: + description: Music On Hold Override + type: string + MusicOnHoldMediaID: + description: Kazoo MOH Media ID + type: string + MwiUnassociatedUpdates: + description: MWI Unassociated Updates? + type: boolean + OwnerID: + description: Kazoo Owner ID + type: string + PbxID: + description: Telnexus PBX ID + type: string + PresenceID: + description: Presence ID + type: string + ProvisionID: + description: Provisioning Record ID + type: string + RegisterOverwriteNotify: + description: Register Overwrite Notify? + type: boolean + Ringtones: + description: Endpoint Ringtones + type: string + RingtonesExternal: + description: Ringtones External + type: string + RingtonesInternal: + description: Ringtones Internal + type: string + SipID: + description: SIP Information Record ID + type: string + SuppressUnregisterNotifications: + description: Suppress Unregister Notifications? + type: boolean + Timezone: + description: Endpoint Timezone Override + type: string + type: object + EndpointRequest: + description: + An array of Endpoint objects sent to be processed in a request + properties: + Data: + items: + $ref: "#/definitions/Endpoint" + type: array + type: object + EndpointResponse: + description: + An array of Endpoint objects sent in response to a request + properties: + Data: + items: + $ref: "#/definitions/Endpoint" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + Error: + properties: + Code: + format: int32 + type: integer + Fields: + type: string + Message: + type: string + type: object + Pbx: + properties: + AccountID: + description: Telnexus Account ID + type: string + BackendID: + description: Backend ID + type: string + BillingContact: + description: Billing Contact ID + type: string + BillingID: + description: Kazoo Billing ID + type: string + BillingMode: + description: Kazoo Billing Mode + type: string + CallRestrictionID: + description: Call Restriction Record ID + type: string + CallerIdEmergencyName: + description: Caller ID Emergency Name + type: string + CallerIdEmergencyNumber: + description: Caller ID Emergency Number + type: string + CallerIdExternalName: + description: Caller ID External Name + type: string + CallerIdExternalNumber: + description: Caller ID External Number + type: string + Created: + description: Date Created + type: string + Enabled: + description: User Enabled? + type: boolean + ID: + description: Telnexus ID + type: string + IsReseller: + description: Is Account a Reseller? + type: boolean + KazooAccountName: + description: Kazoo Account Name + type: string + KazooID: + description: Kazoo PBX ID + type: string + Language: + description: Language + type: string + MusicOnHold: + description: Default Music On Hold + type: string + Name: + description: PBX Name + type: string + Realm: + description: PBX Realm + type: string + ResellerID: + description: Reseller ID + type: string + TechnicalContactID: + description: Technical Contact + type: string + Timezone: + description: PBX Timezone + type: string + type: object + PbxRequest: + properties: + Data: + items: + $ref: "#/definitions/Pbx" + type: array + type: object + PbxResponse: + description: An array of Authority objects + properties: + Data: + items: + $ref: "#/definitions/Pbx" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + PbxUser: + properties: + CallRestrictionID: + description: Call Restriction Record ID + type: string + CallerID: + description: CNAM Override + type: string + ContactID: + description: Telnexus Contact ID + type: string + Email: + description: Email Address + type: string + Enabled: + description: Enabled? + type: boolean + FaxToEmailEnabled: + description: Fax To Email Enabled? + type: boolean + FirstName: + description: First Name + type: string + ID: + description: Telnexus ID + type: string + Language: + description: Language + type: string + LastName: + description: Last Name + type: string + PbxID: + description: Telnexus PBX ID + type: string + PrivLevel: + description: Privilege Level + type: string + RecordCall: + description: RecordCall? + type: boolean + RequirePasswordUpdate: + description: Require Passoword Update? + type: boolean + Timezone: + description: Timezone + type: string + UserID: + description: Kazoo User ID + type: string + UserName: + description: Kazoo Username + type: string + Verified: + description: Verified? + type: boolean + VmToEmailEnabled: + description: Voice Mail to Email Enabled? + type: boolean + type: object + PbxUserRequest: + properties: + Data: + items: + $ref: "#/definitions/PbxUser" + type: array + type: object + PbxUserResponse: + description: An array of PBX objects + properties: + Data: + items: + $ref: "#/definitions/PbxUser" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + PhoneNumber: + properties: + AccountID: + description: Telnexus Account ID + type: string + AuthorityID: + description: AuthorityID + type: string + CompanyID: + description: Telnexus Company ID + type: string + ContactID: + description: Telnexus Contact ID + type: string + ContractID: + description: Telnexus Contract ID + type: string + Description: + description: Description + type: string + Extension: + description: Extension + type: string + FaxLine: + description: Fax Line? + type: boolean + ID: + description: Telnexus Record ID + type: string + Indicator: + description: Indicator + type: string + LocalService: + description: Local Service + type: boolean + LocalToll: + description: Local Toll + type: boolean + LongDistance: + description: Long Distance + type: boolean + LosingCarrier: + description: Losing Carrier + type: string + OpportunityID: + description: Telnexus Opportunity ID + type: string + OrderID: + description: Telnexus Order ID + type: string + PhoneNumber: + description: Phone Number + type: string + PortOut: + description: Is this number to ported out? + type: boolean + ProductID: + description: Telnexus Product ID + type: string + QuoteID: + description: Telnexus Quote ID + type: string + Ratecenter: + description: Rate Center + type: string + Safety: + description: Is this a safety number? + type: boolean + Status: + description: Number Status + type: string + SubscriptionID: + description: Subscription ID + type: string + Tollfree: + description: Tollfree + type: string + Type: + description: Number Type + type: string + WholesalerID: + description: Wholesale Vendor ID + type: string + type: object + PhoneNumberRequest: + properties: + Data: + items: + $ref: "#/definitions/PhoneNumber" + type: array + type: object + PhoneNumberResponse: + description: An array of Phone Number objects + properties: + Data: + items: + $ref: "#/definitions/PhoneNumber" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + Recipient: + type: object + properties: + ID: + description: Telnexus Record Identifier + type: string + Available: + type: string + AvailabilityState: + type: string + QueueAvailability: + type: string + OfferedCall: + type: string + HandlingCall: + type: string + WiretappingRecipient: + type: string + WiretapMode: + type: string + WrapupTimeSeconds: + type: string + Node: + type: string + Stats: + type: object + $ref: "#/definitions/RecipientStats" + RecipientStats: + type: object + properties: + ID: + description: Telnexus Record Identifier + type: string + TotalCalls: + type: number + format: int64 + MissedCalls: + type: number + format: int64 + AvgCallTime: + type: number + format: float64 + LoginTime: + type: number + format: int64 + LastActionTime: + type: number + LastHandledTime: + type: number + RecipientRequest: + properties: + Data: + items: + $ref: "#/definitions/Recipient" + type: array + type: object + RecipientResponse: + description: An array of Recipient objects + properties: + Data: + items: + $ref: "#/definitions/Recipient" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + ResponseMeta: + properties: + Contact: + description: Microservice Contact Info + type: string + Copyright: + description: Copyright Info + type: string + License: + description: License Information and Restrictions + type: string + operationId: + description: Operation ID + type: string + RequestIP: + description: Request IP Address + type: string + RequestType: + description: Request Type + type: string + RequestURL: + description: Request URL + type: string + ServerInfo: + description: Data Server Info + type: string + ServerResponseTime: + description: Data Server Response Time (ms) + type: string + ServerTimestamp: + description: Backend Server Timestamp + type: string + TelnexusAccount: + description: + Telnexus Account Number used for recording transactions + type: string + type: object + Queue: + type: object + properties: + ID: + description: Telnexus Record Identifier + type: string + AgentWrapupTime: + description: + Pre-defined wait period applied after an agent handles a + customer call (in seconds) + type: integer + ForceAwayOnReject: + description: + If set to true and a recipient rejects a call, they will be + forced to away state + type: boolean + HoldTreatment: + description: + Media ID (or appropriate media URI) of media to play while + caller is on hold. + type: string + Name: + description: A friendly name for the queue + type: string + QueueRouter: + default: route_round_robin + description: + The queue router used for routing and delivering calls to + recipients + type: string + QueueType: + description: The type of queue + type: string + RingTimeout: + description: + Amount of time in seconds that qubicle will wait while ringing + for the agent to successfully answer a call. + type: integer + TickTime: + description: The time between delivery ticks in milliseconds + type: integer + Timeout: + description: + The maximum amount of time in seconds that a call will wait in + queue. + type: integer + TimeoutIfSizeExceeds: + description: + If set to a non-zero value the queue will immediately time out + any call entering the queue over the size + type: integer + TimeoutImmediatelyIfEmpty: + description: + If set to true and a call enters the queue while it has no + logged in agents, the call will time out + type: boolean + TimoutRedirect: + description: + The ID of a queue that the call will be sent to in the event + of a timeout + type: string + QueueRequest: + properties: + Data: + items: + $ref: "#/definitions/Queue" + type: array + type: object + QueueResponse: + description: An array of Recipient objects + properties: + Data: + items: + $ref: "#/definitions/Recipient" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + VmBox: + properties: + CheckIfOwner: + description: Check if VM owner is owner of endpoint + type: boolean + DeleteAfterNotify: + description: Delete VM after notification + type: boolean + ID: + description: Telnexus Record ID + type: string + IsSetup: + description: Is this VM Box setup? + type: boolean + KazooID: + description: Kazoo Mailbox Id + type: string + KazooOwnerID: + description: Kazoo User Id + type: string + MailboxNumber: + description: Kazoo Mailbox Number + type: string + Name: + description: Mailbox Name + type: string + NotConfigurable: + description: Not Configurable? + type: boolean + PbxID: + description: Telnexus PBX ID + type: string + RequirePIN: + description: Require PIN? + type: boolean + SaveAfterNotify: + description: Save after notify? + type: boolean + SkipGreeting: + description: Skip Greeting? + type: boolean + SkipInstructions: + description: Skip Instructions? + type: boolean + type: object + VmBoxRequest: + properties: + Data: + items: + $ref: "#/definitions/VmBox" + type: array + type: object + VmBoxResponse: + description: An array of VmBox objects + properties: + Data: + items: + $ref: "#/definitions/VmBox" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + Authority: + properties: + AccountID: + description: Account + type: string + AddressLine1: + description: Address Line 1 + type: string + AddressLine2: + description: Address Line 2 + type: string + BTN: + description: Billing Telephone Number + type: string + City: + description: City + type: string + ContactID: + description: Contact Name + type: string + Country: + description: Country + type: string + CreatedByID: + description: Created By User ID + type: string + CreatedDate: + description: Created Date + type: string + Date: + description: Authority Date + type: string + DateApproved: + description: Date Approved + type: string + ID: + description: Telnexus Record Identifier + type: string + LastModifiedByID: + description: Last Modified By User ID + type: string + LastModifiedDate: + description: Last Modified Date + type: string + LosingCarrier: + description: Losing Carrier + type: string + Name: + description: Authority Number + type: string + NameLine1: + description: Name Line 1 + type: string + NameLine2: + description: Name Line 2 + type: string + OpportunityID: + description: Opportunity Name + type: string + OrderID: + description: Order Number + type: string + ParentFK: + description: + UUID Reference the master record that owns this item + type: string + PostalCode: + description: Zip Code + type: string + QuoteID: + description: Quote Name + type: string + Ref: + description: "Source System identifier for this record, if any" + type: string + State: + description: State + type: string + Status: + description: Status + type: string + TemplateID: + description: ID of the Template for this object instance + type: string + TenantID: + description: Tenant that owns this object instance + type: string + TransferDate: + description: Transfer Date + type: string + Type: + description: Authority Type + type: string + type: object + AuthorityRequest: + properties: + Data: + items: + $ref: "#/definitions/Authority" + type: array + type: object + AuthorityResponse: + description: An array of Authority objects + properties: + Data: + items: + $ref: "#/definitions/Authority" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object + Callflow: + description: + Call flows describe steps to take in order to process a phone + call. They are trees of information related to a phone call such + as "answer, play file, record file" etc. that are logically + grouped together and ordered. + properties: + ID: + description: Telnexus Record Identifier + type: string + FeatureCode: + description: + When the callflow is used as a featurecode this object tracks + the intended match of the pattern and name of the feature + properties: + name: + type: string + number: + type: string + type: object + Flags: + description: Flags set by external applications + items: + type: string + type: array + Flow: + $ref: "#/definitions/CallFlowAction" + description: + A callflow node defines a module to execute, data to provide + to that module, and zero or more children to branch to + # Metaflow: + # $ref: "#/definitions/metaflows" + # description: + # Actions applied to a call outside of the normal callflow, + # initiated by the caller(s) + Numbers: + default: [] + description: + A list of static numbers that the callflow should execute for + items: + maxLength: 36 + minLength: 1 + type: string + type: array + uniqueItems: true + Patterns: + default: [] + description: + A list of regular expressions that the callflow should execute + for, with optional capture groups + items: + minLength: 1 + type: string + type: array + type: object + CallFlowAction: + description: + Call flows describe steps to take in order to process a phone + call. They are trees of information related to a phone call such + as "answer, play file, record file" etc. that are logically + grouped together and ordered. + properties: + ID: + description: Telnexus Record Identifier + type: string + Children: + description: Children callflows + type: object + Data: + default: {} + description: The data/arguments of the callflow module + type: object + Module: + description: + The name of the callflow module to execute at this node + maxLength: 64 + minLength: 1 + type: string + type: object diff --git a/swagger/workflow-telnexus.yaml b/swagger/workflow-telnexus.yaml new file mode 100644 index 0000000..5c69ced --- /dev/null +++ b/swagger/workflow-telnexus.yaml @@ -0,0 +1,586 @@ +swagger: "2.0" +info: + version: 0.0.2 + title: "workflow" + description: "Workflow Microservice" + termsOfService: "http://telnexus.com/terms/" + contact: + email: "noc@telnexus.com" + license: + name: "Proprietary - Copyright (c) 2018-2020 by Telnexus LLC" +securityDefinitions: + ApiKeyAuth: + type: "apiKey" + in: "header" + name: "X-API-Key" +schemes: + - "http" +basePath: "/v1" +host: "workflow.infra.tnxs.net:8080" +consumes: + - "application/json" +produces: + - "application/json" +parameters: + emailMessageIdQuery: + description: Email Message ID + in: query + name: emailMessageId + type: string + OutgoingEmailMessageRequest: + description: An array of new Outgoing Email Message records + in: body + name: OutgoingEmailMessageRequest + required: true + schema: + $ref: "#/definitions/OutgoingEmailMessageRequest" + AppLogRequest: + description: An array of new AppLog records + in: body + name: AppLogRequest + required: true + schema: + $ref: "#/definitions/AppLogRequest" +responses: + AppLogResponse: + description: "Array of AppLogs" + headers: + Access-Control-Allow-Origin: + type: string + schema: + $ref: "#/definitions/AppLogResponse" + EmailMessagesResponse: + description: "Array of Email Messages" + headers: + Access-Control-Allow-Origin: + type: string + schema: + $ref: "#/definitions/EmailMessagesResponse" + AccessForbidden: + description: "Access forbidden, account lacks access" + headers: + Access-Control-Allow-Origin: + type: string + schema: + $ref: "#/definitions/Error" + NotFound: + description: Resource was not found + headers: + Access-Control-Allow-Origin: + type: string + schema: + $ref: "#/definitions/Error" + ServerError: + headers: + Access-Control-Allow-Origin: + type: string + description: Server Internal Error + schema: + $ref: "#/definitions/Error" + Unauthorized: + headers: + Access-Control-Allow-Origin: + type: string + description: "Access Unauthorized, invalid API-KEY was used" + schema: + $ref: "#/definitions/Error" + UnprocessableEntity: + headers: + Access-Control-Allow-Origin: + type: string + description: "Unprocessable Entity, likely a bad parameter" + schema: + $ref: "#/definitions/Error" + CORSResponse: + description: CORS OPTIONS response + headers: + Access-Control-Allow-Origin: + type: string + Access-Control-Allow-Headers: + type: string + Access-Control-Allow-Methods: + type: string + Access-Control-Expose-Headers: + type: string + Access-Control-Max-Age: + type: string + Access-Control-Allow-Credentials: + type: string + Cache-Control: + type: string +paths: + /applogs: + options: + operationId: appLogOptions + description: CORS support + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + post: + security: + - ApiKeyAuth: [] + summary: Post app log messages + operationId: postAppLogs + description: Insert app log messages into workflow storage + parameters: + - $ref: "#/parameters/AppLogRequest" + responses: + "200": + $ref: "#/responses/AppLogResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + tags: + - AppLog + /emailmessages: + options: + operationId: emailMessageOptions + description: CORS support + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + get: + security: + - ApiKeyAuth: [] + summary: "Get email messages from data store" + operationId: getEmailMessages + description: "Retrieves email messages from workflow storage" + parameters: + - $ref: "#/parameters/emailMessageIdQuery" + tags: + - "EmailMessage" + responses: + "200": + $ref: "#/responses/EmailMessagesResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + /outgoingemailmessages: + options: + operationId: outgoingEmailMessageOptions + description: CORS support + responses: + "200": + $ref: "#/responses/CORSResponse" + tags: + - cors + post: + security: + - ApiKeyAuth: [] + summary: Add new email messages to the outgoing queue + operationId: postOutgoingEmailMessages + description: Insert new email messages into workflow storage + parameters: + - $ref: "#/parameters/OutgoingEmailMessageRequest" + responses: + "200": + $ref: "#/responses/EmailMessagesResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + tags: + - OutgoingEmailMessage +definitions: + AppLog: + description: Application Log for human consumption + properties: + AccountID: + type: string + CompanyID: + type: string + CreatedByID: + type: string + CreatedDate: + type: string + ID: + type: string + Message: + type: string + ObjectID: + type: string + ObjectType: + type: string + Severity: + type: string + Source: + type: string + SourceTimestamp: + type: string + type: object + AppLogRequest: + description: An array Telnexus Application Log objects + properties: + data: + items: + $ref: "#/definitions/AppLog" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + AppLogResponse: + description: An array Telnexus Application Log objects + properties: + data: + items: + $ref: "#/definitions/AppLog" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Document: + description: Telnexus Document + properties: + ArchivedByID: + type: string + ArchivedDate: + type: string + AuthorID: + type: string + Body: + format: byte + type: string + BodyLength: + format: int64 + type: number + CommentCount: + format: int64 + type: number + ConnectionID: + type: string + ContentAssetID: + type: string + ContentModificationDate: + type: string + ContentSize: + format: int64 + type: number + ContentType: + type: string + ContentVersionDocumentID: + type: string + ContnetDocumentID: + type: string + CreatedByID: + type: string + CreatedDate: + type: string + DDate: + type: string + Description: + type: string + DeveloperName: + type: string + Discount: + type: number + Document: + format: byte + type: string + DocumentID: + type: string + DocumentSequence: + format: int64 + type: number + Field: + type: string + FileExtension: + type: string + FileType: + type: string + FolderID: + type: string + GrandTotal: + type: string + ID: + type: string + InsertedByID: + type: string + IsArchived: + type: boolean + IsBodySearchable: + type: boolean + IsCommentSub: + type: boolean + IsDocumentSub: + type: boolean + IsInternalUseOnly: + type: boolean + IsPublic: + type: boolean + IsRichText: + type: boolean + Keywords: + type: string + LastModifiedByID: + type: string + LastModifiedDate: + type: string + LastViewedDate: + type: string + LatstPublishedVersionID: + type: string + LikeCount: + format: int64 + type: number + LinkURL: + type: string + LinkedEntityID: + type: string + Name: + type: string + NamespacePrefix: + type: string + NetworkScope: + type: string + OwnerID: + type: string + ParentID: + type: string + Publishstatus: + type: string + QuoteID: + type: string + RelatedRecordID: + type: string + ShareType: + type: string + SharingOption: + type: string + SharingPrivacy: + type: string + Title: + type: string + Type: + type: string + URL: + type: string + UserID: + type: string + Visibility: + type: string + type: object + EmailMessage: + properties: + ActivityID: + type: string + BCCAddress: + type: string + CCAddress: + type: string + CreatedByID: + type: string + CreatedDate: + type: string + EmailMessageID: + type: string + FromAddress: + type: string + FromName: + type: string + HTML: + format: byte + type: string + HasAttachment: + type: boolean + Headers: + $ref: "#/definitions/Headers" + ID: + type: string + Incoming: + type: boolean + IsClientManaged: + type: boolean + IsExternallyManaged: + type: boolean + LastModifiedByID: + type: string + LastModifiedDate: + type: string + MessageDate: + type: string + MessageIdentifier: + type: string + ParentID: + type: string + RelatedToID: + type: string + RelationAddress: + type: string + RelationID: + type: string + RelationObjectType: + type: string + RelationType: + type: string + ReplyToEmailMessageID: + type: string + Status: + type: string + Subject: + type: string + Text: + format: byte + type: string + ThreadIdentifier: + type: string + ToAddress: + type: string + ValidatedFromAddress: + type: string + type: object + EmailMessageRequest: + description: An array Telnexus Send Email Message objects + properties: + data: + items: + $ref: "#/definitions/EmailMessage" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + EmailMessagesResponse: + description: An array Telnexus user objects + properties: + data: + items: + $ref: "#/definitions/EmailMessage" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Error: + properties: + Code: + format: int32 + type: integer + Fields: + type: string + Message: + type: string + type: object + Headers: + type: object + properties: + Key: + type: string + Values: + items: + items: + type: string + type: array + type: array + OutgoingEmailMessage: + description: A new email message to be sent + properties: + BCCAddress: + type: string + CCAddress: + type: string + EmailMessageID: + type: string + EmailTemplateID: + type: string + ExternalID: + type: string + FromContactID: + type: string + FromName: + type: string + Headers: + $ref: "#/definitions/Headers" + HTML: + type: string + ID: + type: string + Subject: + type: string + Text: + type: string + ToAddress: + type: string + ToName: + type: string + ValidatedFromAddress: + type: string + WhoID: + type: string + type: object + OutgoingEmailMessageRequest: + description: An array Telnexus New Email Message objects + properties: + data: + items: + $ref: "#/definitions/OutgoingEmailMessage" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + RequestMeta: + properties: + TelnexusAccount: + description: Telnexus Account Number of the Reseller or OEM + type: string + required: + - TelnexusAccount + type: object + ResponseMeta: + properties: + Contact: + description: Microservice Contact Info + type: string + Copyright: + description: Copyright Info + type: string + License: + description: License Information and Restrictions + type: string + OperationID: + description: Operation ID + type: string + RequestIP: + description: Request IP Address + type: string + RequestType: + description: Request Type + type: string + RequestURL: + description: Request URL + type: string + ServerInfo: + description: Data Server Info + type: string + ServerResponseTime: + description: Data Server Response Time (ms) + type: string + ServerTimestamp: + description: Backend Server Timestamp + type: string + TelnexusAccount: + description: + Telnexus Account Number used for recording transactions + type: string + type: object